support distribution sexes update stats

This commit is contained in:
2022-12-26 11:32:11 +01:00
parent f4bb23df44
commit 3d481f5a74
3 changed files with 151 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 25, 2022 at 09:49 PM
-- Generation Time: Dec 26, 2022 at 10:31 AM
-- Server version: 8.0.31-0ubuntu0.20.04.1
-- PHP Version: 7.4.3
@@ -21,6 +21,8 @@ SET time_zone = "+00:00";
--
-- Database: `telereview`
--
CREATE DATABASE IF NOT EXISTS `telereview` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
USE `telereview`;
-- --------------------------------------------------------
@@ -77,9 +79,10 @@ INSERT INTO `borne_criteres` (`id`, `nom`) VALUES
CREATE TABLE `borne_notes_autre` (
`id` int NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`critere_id` int NOT NULL,
`avis_id` int NOT NULL,
`valeur` int NOT NULL COMMENT 'Note sur 10'
`note` int NOT NULL COMMENT 'Note sur 10'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
@@ -134,16 +137,67 @@ INSERT INTO `sources` (`id`, `nom`) VALUES
-- --------------------------------------------------------
--
-- Table structure for table `stats_annee`
-- Table structure for table `stats_autres_annee`
--
CREATE TABLE `stats_annee` (
CREATE TABLE `stats_autres_annee` (
`id` int NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`critere_id` int NOT NULL,
`note` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `stats_autres_jour`
--
CREATE TABLE `stats_autres_jour` (
`id` int NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`critere_id` int NOT NULL,
`note` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `stats_autres_mois`
--
CREATE TABLE `stats_autres_mois` (
`id` int NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`critere_id` int NOT NULL,
`note` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `stats_autres_semaine`
--
CREATE TABLE `stats_autres_semaine` (
`id` int NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`critere_id` int NOT NULL,
`note` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `stats_general_annee`
--
CREATE TABLE `stats_general_annee` (
`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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
@@ -151,16 +205,15 @@ CREATE TABLE `stats_annee` (
-- --------------------------------------------------------
--
-- Table structure for table `stats_jour`
-- Table structure for table `stats_general_jour`
--
CREATE TABLE `stats_jour` (
CREATE TABLE `stats_general_jour` (
`id` int NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`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;
@@ -168,16 +221,15 @@ CREATE TABLE `stats_jour` (
-- --------------------------------------------------------
--
-- Table structure for table `stats_mois`
-- Table structure for table `stats_general_mois`
--
CREATE TABLE `stats_mois` (
CREATE TABLE `stats_general_mois` (
`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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
@@ -185,16 +237,15 @@ CREATE TABLE `stats_mois` (
-- --------------------------------------------------------
--
-- Table structure for table `stats_semaine`
-- Table structure for table `stats_general_semaine`
--
CREATE TABLE `stats_semaine` (
CREATE TABLE `stats_general_semaine` (
`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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
@@ -246,27 +297,51 @@ ALTER TABLE `sources`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_annee`
-- Indexes for table `stats_autres_annee`
--
ALTER TABLE `stats_annee`
ALTER TABLE `stats_autres_annee`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_jour`
-- Indexes for table `stats_autres_jour`
--
ALTER TABLE `stats_jour`
ALTER TABLE `stats_autres_jour`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_mois`
-- Indexes for table `stats_autres_mois`
--
ALTER TABLE `stats_mois`
ALTER TABLE `stats_autres_mois`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_semaine`
-- Indexes for table `stats_autres_semaine`
--
ALTER TABLE `stats_semaine`
ALTER TABLE `stats_autres_semaine`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_general_annee`
--
ALTER TABLE `stats_general_annee`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_general_jour`
--
ALTER TABLE `stats_general_jour`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_general_mois`
--
ALTER TABLE `stats_general_mois`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stats_general_semaine`
--
ALTER TABLE `stats_general_semaine`
ADD PRIMARY KEY (`id`);
--
@@ -316,27 +391,51 @@ ALTER TABLE `sources`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `stats_annee`
-- AUTO_INCREMENT for table `stats_autres_annee`
--
ALTER TABLE `stats_annee`
ALTER TABLE `stats_autres_annee`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stats_jour`
-- AUTO_INCREMENT for table `stats_autres_jour`
--
ALTER TABLE `stats_jour`
ALTER TABLE `stats_autres_jour`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stats_mois`
-- AUTO_INCREMENT for table `stats_autres_mois`
--
ALTER TABLE `stats_mois`
ALTER TABLE `stats_autres_mois`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stats_semaine`
-- AUTO_INCREMENT for table `stats_autres_semaine`
--
ALTER TABLE `stats_semaine`
ALTER TABLE `stats_autres_semaine`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stats_general_annee`
--
ALTER TABLE `stats_general_annee`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stats_general_jour`
--
ALTER TABLE `stats_general_jour`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stats_general_mois`
--
ALTER TABLE `stats_general_mois`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `stats_general_semaine`
--
ALTER TABLE `stats_general_semaine`
MODIFY `id` int NOT NULL AUTO_INCREMENT;
COMMIT;