changement du stockage des notes autres

This commit is contained in:
2022-12-25 22:50:19 +01:00
parent 0e85ce1156
commit ba88f758b5
3 changed files with 90 additions and 14 deletions

View File

@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 25, 2022 at 06:12 PM
-- Generation Time: Dec 25, 2022 at 09:49 PM
-- Server version: 8.0.31-0ubuntu0.20.04.1
-- PHP Version: 7.4.3
@@ -45,13 +45,45 @@ CREATE TABLE `borne_avis` (
`id_auteur` int NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`note_principale` tinyint NOT NULL,
`notes_autre` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'Notes spécifiques au format JSON',
`commentaire` text NOT NULL,
`source_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `borne_criteres`
--
CREATE TABLE `borne_criteres` (
`id` int NOT NULL,
`nom` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `borne_criteres`
--
INSERT INTO `borne_criteres` (`id`, `nom`) VALUES
(1, 'proprete'),
(2, 'calme'),
(3, 'attente');
-- --------------------------------------------------------
--
-- Table structure for table `borne_notes_autre`
--
CREATE TABLE `borne_notes_autre` (
`id` int NOT NULL,
`critere_id` int NOT NULL,
`avis_id` int NOT NULL,
`valeur` int NOT NULL COMMENT 'Note sur 10'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `reseaux_sociaux_auteurs`
--
@@ -125,12 +157,12 @@ CREATE TABLE `stats_annee` (
CREATE TABLE `stats_jour` (
`id` int NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`moyenne_globale` float NOT NULL,
`moyenne_site` float NOT NULL,
`moyenne_borne` float NOT NULL,
`moyenne_autres` text NOT NULL COMMENT 'Nombres séparés par des ; => moyennes spécifiques',
`dist_age` text NOT NULL COMMENT 'Distribution de l''age des auteurs',
`dist_sexe` text NOT NULL COMMENT 'Distribution du sexe des auteurs'
`moyenne_globale` float DEFAULT NULL,
`moyenne_site` float DEFAULT NULL,
`moyenne_borne` float DEFAULT NULL,
`moyenne_autres` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'Nombres séparés par des ; => moyennes spécifiques',
`dist_age` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'Distribution de l''age des auteurs',
`dist_sexe` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT 'Distribution du sexe des auteurs'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
@@ -183,6 +215,18 @@ ALTER TABLE `borne_auteurs`
ALTER TABLE `borne_avis`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `borne_criteres`
--
ALTER TABLE `borne_criteres`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `borne_notes_autre`
--
ALTER TABLE `borne_notes_autre`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `reseaux_sociaux_auteurs`
--
@@ -241,6 +285,18 @@ ALTER TABLE `borne_auteurs`
ALTER TABLE `borne_avis`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `borne_criteres`
--
ALTER TABLE `borne_criteres`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `borne_notes_autre`
--
ALTER TABLE `borne_notes_autre`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `reseaux_sociaux_auteurs`
--