/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `absenceetudiant`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `absenceetudiant` (
  `absetud_id` int NOT NULL AUTO_INCREMENT,
  `absetud_date` date NOT NULL,
  `absetud_type` int NOT NULL,
  `absetud_ins_id` int NOT NULL,
  `absetud_seance_id` int NOT NULL,
  `absetud_justif` varchar(100) DEFAULT NULL,
  `absetud_duree` int DEFAULT NULL,
  PRIMARY KEY (`absetud_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `absenceprof`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `absenceprof` (
  `absprof_id` int NOT NULL AUTO_INCREMENT,
  `absprof_date` date NOT NULL,
  `absprof_prof_id` int NOT NULL,
  `absprof_seance_id` int NOT NULL,
  PRIMARY KEY (`absprof_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `academic_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `academic_messages` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `sender_id` bigint unsigned NOT NULL,
  `receiver_id` bigint unsigned NOT NULL,
  `subject` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('assignment','question','feedback','general') COLLATE utf8mb4_unicode_ci NOT NULL,
  `related_to` bigint unsigned DEFAULT NULL,
  `related_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('unread','read','archived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unread',
  `priority` enum('high','medium','low') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `accueil`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `accueil` (
  `acc_id` int NOT NULL AUTO_INCREMENT,
  `acc_date_ajout` datetime NOT NULL,
  `acc_date` date NOT NULL,
  `acc_nom` varchar(100) NOT NULL,
  `acc_prenom` varchar(100) NOT NULL,
  `acc_adress` text NOT NULL,
  `acc_tel` varchar(20) NOT NULL,
  `acc_email` varchar(250) NOT NULL,
  `acc_diplome` varchar(250) NOT NULL,
  `acc_specialite` varchar(250) NOT NULL,
  `acc_annee_obtention` varchar(9) NOT NULL,
  `acc_activite_actuel` varchar(250) NOT NULL,
  `acc_connu_ecole` varchar(250) NOT NULL,
  `acc_remarques` text NOT NULL,
  PRIMARY KEY (`acc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `anneescolaire`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `anneescolaire` (
  `annee_id` int unsigned NOT NULL,
  `annee_nom` varchar(30) NOT NULL,
  `annee_datedeb` date NOT NULL,
  `annee_datefin` date NOT NULL,
  PRIMARY KEY (`annee_id`) USING BTREE,
  KEY `annee_nom` (`annee_nom`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `announcements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `announcements` (
  `ann_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ann_title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ann_content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `ann_type` enum('school-wide','class-specific','grade-specific','deadline','exam','event') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'school-wide',
  `ann_target_audience` enum('all','students','teachers','parents','staff') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'all',
  `ann_priority` enum('high','medium','low') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `ann_status` enum('active','archived','draft') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `ann_created_by` bigint unsigned NOT NULL,
  `ann_course_id` bigint unsigned DEFAULT NULL,
  `ann_class_id` bigint unsigned DEFAULT NULL,
  `ann_start_date` timestamp NULL DEFAULT NULL,
  `ann_end_date` timestamp NULL DEFAULT NULL,
  `ann_due_date` timestamp NULL DEFAULT NULL,
  `ann_attachments` json DEFAULT NULL,
  `ann_metadata` json DEFAULT NULL,
  `ann_is_pinned` tinyint(1) NOT NULL DEFAULT '0',
  `ann_view_count` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`ann_id`),
  KEY `announcements_ann_status_ann_is_pinned_created_at_index` (`ann_status`,`ann_is_pinned`,`created_at`),
  KEY `announcements_ann_type_ann_target_audience_index` (`ann_type`,`ann_target_audience`),
  KEY `announcements_ann_created_by_created_at_index` (`ann_created_by`,`created_at`),
  KEY `announcements_ann_start_date_ann_end_date_index` (`ann_start_date`,`ann_end_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attachement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attachement` (
  `att_id` int NOT NULL AUTO_INCREMENT,
  `att_ext` varchar(3) NOT NULL,
  `att_taille` varchar(25) NOT NULL,
  `att_url` varchar(100) NOT NULL,
  PRIMARY KEY (`att_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attestation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attestation` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nom` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `attestation_generer`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `attestation_generer` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `attes_code` varchar(200) NOT NULL,
  `date_generation` bigint NOT NULL,
  `ins_id` int unsigned NOT NULL,
  `attestation_id` int unsigned NOT NULL,
  `attes_deleted` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `backup_resultat_exam`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `backup_resultat_exam` (
  `bk_id` int NOT NULL AUTO_INCREMENT,
  `bk_exam_id` int NOT NULL,
  `bk_type_exam` int DEFAULT NULL,
  `bk_ins_id` int DEFAULT NULL,
  `bk_emo_id` int DEFAULT NULL,
  `bk_note` decimal(20,2) DEFAULT NULL,
  `bk_details` char(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `bk_date` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`bk_id`) USING BTREE,
  KEY `bk_exam_id` (`bk_exam_id`) USING BTREE,
  KEY `bk_type_exam` (`bk_type_exam`) USING BTREE,
  KEY `bk_emo_id` (`bk_emo_id`) USING BTREE,
  KEY `bk_ins_id` (`bk_ins_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `banques`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `banques` (
  `bnk_id` int NOT NULL AUTO_INCREMENT,
  `bnk_nom` varchar(50) NOT NULL,
  `bnk_nom_ar` varchar(50) DEFAULT NULL,
  `bnk_code` int NOT NULL,
  `bnk_description` varchar(300) NOT NULL,
  PRIMARY KEY (`bnk_id`),
  UNIQUE KEY `bnk_code` (`bnk_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `campagne`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `campagne` (
  `camp_id` int unsigned NOT NULL,
  `camp_nom` varchar(60) NOT NULL,
  `camp_date_debut` date DEFAULT NULL,
  `camp_date_fin` date DEFAULT NULL,
  PRIMARY KEY (`camp_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `centre`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `centre` (
  `ct_id` int unsigned NOT NULL AUTO_INCREMENT,
  `ct_nom` varchar(80) NOT NULL,
  `ct_nat_id` int unsigned DEFAULT NULL,
  `ct_ville_id` int unsigned DEFAULT NULL,
  `ct_code` varchar(5) DEFAULT NULL,
  PRIMARY KEY (`ct_id`) USING BTREE,
  KEY `ct_ville_id` (`ct_ville_id`),
  KEY `ct_nat_id` (`ct_nat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `classe`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `classe` (
  `classe_id` int unsigned NOT NULL AUTO_INCREMENT,
  `classe_nom` varchar(100) DEFAULT NULL,
  `classe_visible` tinyint(1) DEFAULT '1',
  `classe_formation_id` int unsigned NOT NULL,
  `classe_abbr` varchar(50) NOT NULL DEFAULT '',
  `classe_nom_court` varchar(200) NOT NULL DEFAULT '',
  `classe_nom_complet` varchar(300) NOT NULL DEFAULT '',
  `classe_niveau_filiere` int unsigned NOT NULL DEFAULT '0',
  `classe_niveau_apresbac` int unsigned NOT NULL DEFAULT '0',
  `classe_asdebut` int unsigned NOT NULL,
  `classe_asfin` int unsigned NOT NULL,
  PRIMARY KEY (`classe_id`),
  KEY `classe_abbr` (`classe_abbr`),
  KEY `classe_formation_id` (`classe_formation_id`),
  KEY `classe_niveau_filiere` (`classe_niveau_filiere`),
  KEY `classe_niveau_apresbac` (`classe_niveau_apresbac`),
  KEY `classe_asdebut` (`classe_asdebut`),
  KEY `classe_asfin` (`classe_asfin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `classe_cohort`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `classe_cohort` (
  `id` int NOT NULL AUTO_INCREMENT,
  `classe_id` int NOT NULL,
  `mode_id` int DEFAULT NULL,
  `cohort_id` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `classe_typereleve`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `classe_typereleve` (
  `id` int NOT NULL AUTO_INCREMENT,
  `classe_id` int NOT NULL,
  `typereleve_id` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `comments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `feed_id` bigint unsigned NOT NULL,
  `body` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `comments_feed_id_foreign` (`feed_id`),
  CONSTRAINT `comments_feed_id_foreign` FOREIGN KEY (`feed_id`) REFERENCES `feeds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `conversation_participants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `conversation_participants` (
  `part_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `part_conv_id` bigint unsigned NOT NULL,
  `part_user_id` bigint unsigned NOT NULL,
  `part_role` enum('member','admin','moderator','observer') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'member',
  `part_is_muted` tinyint(1) NOT NULL DEFAULT '0',
  `part_is_active` tinyint(1) NOT NULL DEFAULT '1',
  `part_joined_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `part_last_read_at` timestamp NULL DEFAULT NULL,
  `part_left_at` timestamp NULL DEFAULT NULL,
  `part_settings` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`part_id`),
  UNIQUE KEY `unique_active_participant` (`part_conv_id`,`part_user_id`,`part_is_active`),
  KEY `conversation_participants_part_user_id_part_is_active_index` (`part_user_id`,`part_is_active`),
  KEY `conversation_participants_part_conv_id_part_is_active_index` (`part_conv_id`,`part_is_active`),
  KEY `conversation_participants_part_last_read_at_index` (`part_last_read_at`),
  CONSTRAINT `conversation_participants_part_conv_id_foreign` FOREIGN KEY (`part_conv_id`) REFERENCES `conversations` (`conv_id`) ON DELETE CASCADE,
  CONSTRAINT `conversation_participants_part_user_id_foreign` FOREIGN KEY (`part_user_id`) REFERENCES `n_utilisateurs` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `conversations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `conversations` (
  `conv_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `conv_title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `conv_type` enum('private','group') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'private',
  `conv_status` enum('active','pending','approved','archived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `conv_created_by` bigint unsigned NOT NULL,
  `conv_last_message_at` timestamp NULL DEFAULT NULL,
  `conv_is_active` tinyint(1) NOT NULL DEFAULT '1',
  `conv_metadata` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`conv_id`),
  KEY `conversations_conv_created_by_foreign` (`conv_created_by`),
  KEY `conversations_conv_status_conv_is_active_index` (`conv_status`,`conv_is_active`),
  KEY `conversations_conv_last_message_at_index` (`conv_last_message_at`),
  CONSTRAINT `conversations_conv_created_by_foreign` FOREIGN KEY (`conv_created_by`) REFERENCES `n_utilisateurs` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_student`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `course_student` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `course_id` bigint unsigned NOT NULL,
  `student_id` bigint unsigned NOT NULL,
  `enrollment_status` enum('enrolled','pending','dropped','completed','transferred') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'enrolled',
  `enrolled_at` date DEFAULT NULL,
  `dropped_at` date DEFAULT NULL,
  `grade` decimal(5,2) DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `attendance_data` json DEFAULT NULL,
  `performance_data` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_active_student_course` (`course_id`,`student_id`,`is_active`),
  KEY `course_student_student_id_enrollment_status_index` (`student_id`,`enrollment_status`),
  KEY `course_student_course_id_enrollment_status_index` (`course_id`,`enrollment_status`),
  KEY `course_student_enrolled_at_dropped_at_index` (`enrolled_at`,`dropped_at`),
  KEY `course_student_grade_index` (`grade`),
  CONSTRAINT `course_student_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`) ON DELETE CASCADE,
  CONSTRAINT `course_student_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `n_utilisateurs` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `course_teacher`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `course_teacher` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `course_id` bigint unsigned NOT NULL,
  `teacher_id` bigint unsigned NOT NULL,
  `role` enum('primary','assistant','substitute') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'primary',
  `assigned_from` date DEFAULT NULL,
  `assigned_until` date DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `permissions` json DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_active_teacher_course` (`course_id`,`teacher_id`,`is_active`),
  KEY `course_teacher_teacher_id_is_active_index` (`teacher_id`,`is_active`),
  KEY `course_teacher_course_id_role_index` (`course_id`,`role`),
  KEY `course_teacher_assigned_from_assigned_until_index` (`assigned_from`,`assigned_until`),
  CONSTRAINT `course_teacher_course_id_foreign` FOREIGN KEY (`course_id`) REFERENCES `courses` (`course_id`) ON DELETE CASCADE,
  CONSTRAINT `course_teacher_teacher_id_foreign` FOREIGN KEY (`teacher_id`) REFERENCES `n_utilisateurs` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `courses` (
  `course_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `course_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `course_code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `course_description` text COLLATE utf8mb4_unicode_ci,
  `course_status` enum('active','inactive','archived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `course_teacher_id` bigint unsigned DEFAULT NULL,
  `course_formation_id` bigint unsigned DEFAULT NULL,
  `course_niveau_id` bigint unsigned DEFAULT NULL,
  `course_semestre_id` bigint unsigned DEFAULT NULL,
  `course_credits` int NOT NULL DEFAULT '0',
  `course_hours` int NOT NULL DEFAULT '0',
  `course_schedule` json DEFAULT NULL,
  `course_metadata` json DEFAULT NULL,
  `course_color` varchar(7) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#3498db',
  `course_is_mandatory` tinyint(1) NOT NULL DEFAULT '1',
  `course_start_date` date DEFAULT NULL,
  `course_end_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`course_id`),
  UNIQUE KEY `courses_course_code_unique` (`course_code`),
  KEY `courses_course_status_course_is_mandatory_index` (`course_status`,`course_is_mandatory`),
  KEY `courses_course_teacher_id_course_status_index` (`course_teacher_id`,`course_status`),
  KEY `courses_course_formation_id_course_niveau_id_index` (`course_formation_id`,`course_niveau_id`),
  KEY `courses_course_start_date_course_end_date_index` (`course_start_date`,`course_end_date`),
  CONSTRAINT `courses_course_teacher_id_foreign` FOREIGN KEY (`course_teacher_id`) REFERENCES `n_utilisateurs` (`user_id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ctr`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ctr` (
  `ctr_id` int NOT NULL AUTO_INCREMENT,
  `ctr_num` varchar(2) DEFAULT NULL,
  `ctr_coeff` int DEFAULT NULL,
  `ctr_classe_id` int NOT NULL,
  `ctr_sess_id` int NOT NULL,
  `ctr_annee_id` int NOT NULL,
  `ctr_typectr_id` int NOT NULL,
  PRIMARY KEY (`ctr_id`),
  KEY `ctr_classe_id` (`ctr_classe_id`),
  KEY `ctr_sess_id` (`ctr_sess_id`),
  KEY `ctr_annee_id` (`ctr_annee_id`),
  KEY `ctr_typectr_id` (`ctr_typectr_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ctrmm`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ctrmm` (
  `ctrmm_id` int NOT NULL AUTO_INCREMENT,
  `ctrmm_ctr_id` int NOT NULL,
  `ctrmm_mm_id` int NOT NULL,
  `ctrmm_date` date DEFAULT NULL,
  `ctrmm_annee_scolaire_id` int DEFAULT NULL,
  PRIMARY KEY (`ctrmm_id`),
  KEY `ctrmm_ctr_id` (`ctrmm_ctr_id`),
  KEY `ctrmm_mm_id` (`ctrmm_mm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `demande`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `demande` (
  `demande_id` int NOT NULL AUTO_INCREMENT,
  `demande_nom` varchar(40) NOT NULL,
  `demande_selected` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'This will be used to determin whether to display the item to student or not during document request process',
  `demande_fois` tinyint(1) DEFAULT NULL COMMENT 'How many time can student request this document',
  `demande_signe_pos` varchar(30) DEFAULT NULL,
  `demande_skeleton_file` varchar(50) DEFAULT NULL,
  `demande_page_param` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`demande_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `demande_statut`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `demande_statut` (
  `ds_id` int NOT NULL AUTO_INCREMENT,
  `ds_nom` varchar(20) NOT NULL,
  `ds_label` varchar(20) NOT NULL,
  PRIMARY KEY (`ds_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `dep_ben`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dep_ben` (
  `db_id` int NOT NULL AUTO_INCREMENT,
  `db_type` int NOT NULL,
  `db_nom` varchar(250) NOT NULL,
  PRIMARY KEY (`db_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `dep_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dep_log` (
  `dl_id` int NOT NULL AUTO_INCREMENT,
  `dl_dep_id` int NOT NULL,
  `dl_admin_id` int NOT NULL,
  `dl_date_ajout` datetime NOT NULL,
  `dl_desc` text NOT NULL,
  PRIMARY KEY (`dl_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `dep_ref`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dep_ref` (
  `dep_ref_id` int NOT NULL AUTO_INCREMENT,
  `dep_ref_nom` varchar(100) NOT NULL,
  PRIMARY KEY (`dep_ref_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `departement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `departement` (
  `depart_id` int NOT NULL AUTO_INCREMENT,
  `depart_nom` varchar(100) NOT NULL,
  PRIMARY KEY (`depart_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `departement_classe`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `departement_classe` (
  `departclasse_id` int NOT NULL AUTO_INCREMENT,
  `departclasse_depart_id` int NOT NULL,
  `departclasse_classe_id` int NOT NULL,
  PRIMARY KEY (`departclasse_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `depense`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `depense` (
  `depense_id` int NOT NULL AUTO_INCREMENT,
  `depense_num` varchar(7) NOT NULL,
  `depense_type` int NOT NULL,
  `depense_date` date NOT NULL,
  `depense_ben_id` int NOT NULL,
  `depense_dep_ref_id` int NOT NULL,
  `depense_montant` decimal(10,2) NOT NULL,
  `depense_desc` text NOT NULL,
  `depense_methpay` int NOT NULL,
  `depense_methpay_num` varchar(50) DEFAULT NULL,
  `depense_methpay_date` date DEFAULT NULL,
  `depense_att_1` varchar(250) DEFAULT NULL,
  `depense_att_2` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`depense_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `depense_details`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `depense_details` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `depense_id` bigint NOT NULL,
  `amount` varchar(50) NOT NULL,
  `depense_detail_date` date NOT NULL,
  PRIMARY KEY (`id`),
  KEY `depense_id` (`depense_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `depenses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `depenses` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `supplier_id` bigint NOT NULL,
  `amount` decimal(6,2) NOT NULL,
  `depense_date` date NOT NULL,
  `invoice` varchar(15) NOT NULL,
  `nature` varchar(50) NOT NULL,
  `type` varchar(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_id` (`supplier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `destinataire_sms`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `destinataire_sms` (
  `ds_id` int NOT NULL AUTO_INCREMENT,
  `ds_sms_id` int NOT NULL,
  `ds_user_id` int NOT NULL,
  PRIMARY KEY (`ds_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `details_calendrier_pedagogique`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `details_calendrier_pedagogique` (
  `Det_id` int NOT NULL AUTO_INCREMENT,
  `Det_niveau` int NOT NULL,
  `Det_label` varchar(255) NOT NULL,
  `Det_date_debut` date NOT NULL,
  `Det_date_fin` date NOT NULL,
  `Det_calendrier_id` int NOT NULL,
  `Det_details_id` int DEFAULT NULL,
  PRIMARY KEY (`Det_id`) USING BTREE,
  KEY `idx_det_calendrier_id` (`Det_calendrier_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `devoir`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `devoir` (
  `dev_id` int NOT NULL AUTO_INCREMENT,
  `dev_titre` varchar(100) NOT NULL,
  `dev_description` text NOT NULL,
  `dev_date_debut` date NOT NULL,
  `dev_date_fin` datetime NOT NULL,
  `dev_fichier_url` varchar(100) NOT NULL,
  `dev_classe_id` int NOT NULL,
  `dev_prof_id` int NOT NULL,
  `dev_seance_id` int NOT NULL,
  PRIMARY KEY (`dev_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `devoiretud`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `devoiretud` (
  `devetud_id` int NOT NULL AUTO_INCREMENT,
  `devetud_dev_id` int NOT NULL,
  `devetud_ins_id` int NOT NULL,
  `devetud_date` datetime NOT NULL,
  `devetud_fichier_url` varchar(100) NOT NULL,
  `devetud_note` decimal(10,2) DEFAULT NULL,
  `devetud_remarque` text NOT NULL,
  PRIMARY KEY (`devetud_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `direction`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `direction` (
  `dir_id` int NOT NULL AUTO_INCREMENT,
  `dir_nom` varchar(50) NOT NULL,
  `dir_prenom` varchar(50) NOT NULL,
  `dir_sexe` char(1) NOT NULL,
  `dir_cin` varchar(20) DEFAULT NULL,
  `dir_datenaiss` date DEFAULT NULL,
  `dir_lieunaiss` varchar(50) DEFAULT NULL,
  `dir_adresse` varchar(200) DEFAULT NULL,
  `dir_ville_id` int unsigned DEFAULT NULL,
  `dir_email` varchar(100) DEFAULT NULL,
  `dir_tel` varchar(50) DEFAULT NULL,
  `dir_user_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`dir_id`),
  KEY `dir_user_id` (`dir_user_id`),
  KEY `dir_ville_id` (`dir_ville_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `documents_prof`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `documents_prof` (
  `doc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `doc_prof_id` int unsigned NOT NULL COMMENT 'ID du professeur',
  `doc_type_id` int unsigned NOT NULL COMMENT 'ID du type de document',
  `doc_date_expiration` date DEFAULT NULL,
  `doc_remarques` text COMMENT 'Remarques sur le document',
  `doc_chemin` varchar(255) DEFAULT NULL COMMENT 'Chemin du fichier',
  `doc_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Archivé (0: non, 1: oui)',
  PRIMARY KEY (`doc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Table pour les documents des professeurs';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `emploitemps`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `emploitemps` (
  `emploi_id` int NOT NULL AUTO_INCREMENT,
  `emploi_classe_id` int NOT NULL,
  `emploi_annee_id` int NOT NULL,
  `emploi_sess_id` int NOT NULL,
  PRIMARY KEY (`emploi_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etud_abs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etud_abs` (
  `absetud_id` int NOT NULL AUTO_INCREMENT,
  `absetud_date` date NOT NULL,
  `absetud_type` int NOT NULL,
  `absetud_ins_id` int NOT NULL,
  `absetud_seance_id` int NOT NULL,
  `absetud_justif` varchar(100) DEFAULT NULL,
  `absetud_duree` int DEFAULT NULL,
  PRIMARY KEY (`absetud_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etud_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etud_log` (
  `el_id` int NOT NULL AUTO_INCREMENT,
  `el_etud_id` int NOT NULL,
  `el_admin_id` int NOT NULL,
  `el_date_ajout` datetime NOT NULL,
  `el_log` text NOT NULL,
  PRIMARY KEY (`el_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etud_obs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etud_obs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `etud_id` int DEFAULT NULL,
  `obs_id` int DEFAULT NULL,
  `status` tinyint DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etud_piece`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etud_piece` (
  `etud_id` int NOT NULL,
  `piece_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etud_remarque`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etud_remarque` (
  `er_id` int NOT NULL AUTO_INCREMENT,
  `er_etud_id` int NOT NULL,
  `er_admin_id` int NOT NULL,
  `er_date_ajout` datetime NOT NULL,
  `er_remarque` text NOT NULL,
  PRIMARY KEY (`er_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etudiant`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etudiant` (
  `etud_id` int NOT NULL AUTO_INCREMENT,
  `etud_nom` varchar(50) NOT NULL,
  `etud_prenom` varchar(50) NOT NULL,
  `etud_nom_ar` varchar(50) DEFAULT NULL,
  `etud_prenom_ar` varchar(50) DEFAULT NULL,
  `etud_sexe` char(1) NOT NULL,
  `etud_cin` varchar(20) DEFAULT NULL,
  `etud_datenaiss` date DEFAULT NULL,
  `etud_lieunaiss` varchar(50) DEFAULT NULL,
  `etud_lieunaiss_ar` varchar(50) DEFAULT NULL,
  `etud_adresse` varchar(200) DEFAULT NULL,
  `etud_ville_id` int DEFAULT NULL,
  `etud_nat_id` int NOT NULL,
  `etud_email` varchar(100) DEFAULT NULL,
  `etud_tel` varchar(50) DEFAULT NULL,
  `etud_bac_id` int DEFAULT NULL,
  `etud_serie_bac` varchar(50) DEFAULT NULL,
  `etud_centre_id` int NOT NULL DEFAULT '1',
  `etud_abandonne` tinyint(1) DEFAULT '0',
  `etud_status` tinyint(1) DEFAULT '0',
  `a_decalage` tinyint(1) DEFAULT '0',
  `etud_dec` tinyint(1) DEFAULT '0',
  `etud_valide` tinyint(1) DEFAULT '1',
  `etud_dossier_complet` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`etud_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etudiant_document`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etudiant_document` (
  `id` int NOT NULL AUTO_INCREMENT,
  `etud_id` int NOT NULL,
  `doc_id` int NOT NULL,
  `doc_date_submit` bigint DEFAULT NULL,
  `doc_source` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `doc_notice` mediumtext CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `doc_accept` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etudiant_inscription`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etudiant_inscription` (
  `ins_id` int NOT NULL AUTO_INCREMENT,
  `ins_date` date DEFAULT NULL,
  `ins_numero` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `ins_etud_id` int NOT NULL,
  `ins_classe_id` int NOT NULL,
  `ins_annee_id` int NOT NULL,
  `ins_typeformation` int DEFAULT NULL,
  `ins_form_der_id` int DEFAULT '1',
  `ins_statut` int NOT NULL,
  `ins_valide` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`ins_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etudiant_mdluser`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etudiant_mdluser` (
  `id` int NOT NULL AUTO_INCREMENT,
  `etud_id` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `bloqued` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `etud_id` (`etud_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etudiant_tag`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etudiant_tag` (
  `tag_id` int DEFAULT NULL,
  `etud_id` int DEFAULT NULL,
  `user_ref` int DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `etudiants_option`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `etudiants_option` (
  `etudopt_id` int NOT NULL AUTO_INCREMENT,
  `etudopt_option` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  PRIMARY KEY (`etudopt_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `evenement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `evenement` (
  `even_id` int NOT NULL AUTO_INCREMENT,
  `even_date_debut` datetime NOT NULL,
  `even_date_fin` datetime DEFAULT NULL,
  `even_text` mediumtext NOT NULL,
  `even_user_ref_id` int NOT NULL,
  PRIMARY KEY (`even_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `failed_jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `feeds`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `feeds` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `fiche`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `fiche` (
  `fiche_id` int NOT NULL AUTO_INCREMENT,
  `fiche_nom` varchar(50) NOT NULL,
  `fiche_modal_nom` varchar(30) NOT NULL,
  PRIMARY KEY (`fiche_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `file_upload_permessions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `file_upload_permessions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `filiere_id` int DEFAULT NULL,
  `classe` int DEFAULT NULL,
  `annee_scolaire_id` int DEFAULT NULL,
  `upload_date` datetime DEFAULT NULL,
  `permission` int DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `filiere`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `filiere` (
  `fil_id` int unsigned NOT NULL AUTO_INCREMENT,
  `fil_nom` varchar(100) NOT NULL DEFAULT '',
  `fil_nom_ar` varchar(200) DEFAULT NULL,
  `fil_abbr` varchar(20) NOT NULL DEFAULT '',
  `fil_dom_id` int unsigned NOT NULL,
  PRIMARY KEY (`fil_id`),
  UNIQUE KEY `fil_abbr` (`fil_abbr`),
  KEY `fil_dom_id` (`fil_dom_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `filiere_bac`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `filiere_bac` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `bac_id` int unsigned DEFAULT NULL,
  `filiere_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `formation_deroulement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `formation_deroulement` (
  `form_der_id` int NOT NULL AUTO_INCREMENT,
  `form_der_type` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `form_short` varchar(3) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `form_select` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`form_der_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `garant_financiere`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `garant_financiere` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `nom` varchar(60) DEFAULT NULL,
  `tel` varchar(30) DEFAULT NULL,
  `visiteur_id` int unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `groupes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `groupes` (
  `grp_id` int NOT NULL AUTO_INCREMENT,
  `grp_nom` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`grp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `historique_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `historique_log` (
  `log_id` int NOT NULL AUTO_INCREMENT,
  `log_text` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `log_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `log_utilisateur_id` int DEFAULT NULL,
  PRIMARY KEY (`log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `inscription`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `inscription` (
  `ins_id` int NOT NULL AUTO_INCREMENT,
  `ins_date` date NOT NULL,
  `ins_seq` int unsigned DEFAULT '0',
  `ins_numero` varchar(20) DEFAULT NULL,
  `ins_etud_id` int NOT NULL,
  `ins_classe_id` int NOT NULL,
  `ins_annee_id` int NOT NULL,
  `ins_typeformation` int DEFAULT NULL,
  `ins_statut` int NOT NULL,
  `ins_form_der_id` int DEFAULT '1',
  `ins_abond` tinyint(1) NOT NULL DEFAULT '0',
  `ins_valide` int NOT NULL DEFAULT '0',
  `ins_dec` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`ins_id`),
  KEY `ins_etud_id` (`ins_etud_id`),
  KEY `ins_classe_id` (`ins_classe_id`),
  KEY `ins_annee_id` (`ins_annee_id`),
  KEY `ins_form_der_id` (`ins_form_der_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `inscription_demande`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `inscription_demande` (
  `insdem_id` int NOT NULL AUTO_INCREMENT,
  `insdem_ins_id` int NOT NULL,
  `insdem_demande_id` int NOT NULL,
  `insdem_date` datetime NOT NULL,
  `insdem_tirer` tinyint NOT NULL DEFAULT '0',
  `insdem_paiement_statut` tinyint(1) DEFAULT '0',
  `insdem_dossier_statut` tinyint(1) DEFAULT '0',
  `insdem_prete` tinyint(1) DEFAULT '0',
  `insdem_prete_date` date DEFAULT NULL,
  `insdem_livre` tinyint(1) NOT NULL DEFAULT '0',
  `insdem_livre_date` datetime DEFAULT NULL,
  `insdem_annuler` tinyint(1) DEFAULT '0',
  `insdem_raison` mediumtext CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `insdem_actual` tinyint(1) DEFAULT '0',
  `user_id` tinyint unsigned DEFAULT '0',
  `demande_statut_id` int DEFAULT '1',
  PRIMARY KEY (`insdem_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `inscription_demande_remarque`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `inscription_demande_remarque` (
  `id` int NOT NULL AUTO_INCREMENT,
  `remarque` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `user` int NOT NULL,
  `insc_demande_id` int NOT NULL,
  `date_remarque` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `inscription_diplome`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `inscription_diplome` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ins_id` int NOT NULL,
  `annee_id` int NOT NULL,
  `diplome_numero` int NOT NULL,
  `diplome_date` datetime DEFAULT NULL,
  `diplome_livre` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `inscription_document`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `inscription_document` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ins_id` int NOT NULL,
  `doc_id` int NOT NULL,
  `doc_date_submit` bigint DEFAULT NULL,
  `doc_source` varchar(200) DEFAULT NULL,
  `doc_notice` mediumtext,
  `doc_accept` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ins_id` (`ins_id`),
  KEY `doc_id` (`doc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `inscription_option`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `inscription_option` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `inscription_tag`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `inscription_tag` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `inscription_id` int unsigned DEFAULT NULL,
  `tag_id` int unsigned DEFAULT NULL,
  `user_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `jobs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `langue_niveau`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `langue_niveau` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `langue_nom` varchar(20) NOT NULL,
  `niveau` varchar(30) NOT NULL,
  `ins_id` int unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `likes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `likes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `feed_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `likes_feed_id_foreign` (`feed_id`),
  CONSTRAINT `likes_feed_id_foreign` FOREIGN KEY (`feed_id`) REFERENCES `feeds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `mail` (
  `mail_id` int NOT NULL AUTO_INCREMENT,
  `mail_sender_id` int NOT NULL,
  `mail_receiver_id` int NOT NULL,
  `mail_objet` varchar(50) NOT NULL,
  `mail_message` text NOT NULL,
  `mail_date_envoi` datetime NOT NULL,
  `mail_etat` int NOT NULL,
  `mail_trash` int NOT NULL,
  PRIMARY KEY (`mail_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mailatt`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `mailatt` (
  `mailatt_id` int NOT NULL AUTO_INCREMENT,
  `mailatt_mail_id` int NOT NULL,
  `mailatt_att_id` int NOT NULL,
  PRIMARY KEY (`mailatt_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `matiere`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `matiere` (
  `mat_id` int NOT NULL AUTO_INCREMENT,
  `mat_nom` varchar(100) NOT NULL,
  `mat_classe_id` int DEFAULT NULL,
  `mat_semestre_id` int DEFAULT NULL,
  `mat_dependent` tinyint(1) NOT NULL DEFAULT '0',
  `is_module` int DEFAULT NULL,
  `mat_annee_id` int DEFAULT NULL,
  `mat_visible` tinyint(1) DEFAULT '1',
  `mat_pfe` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`mat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `menu`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `menu` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nom` varchar(200) NOT NULL,
  `url` varchar(200) NOT NULL,
  `icon` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `message_attachments`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `message_attachments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `attachable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `attachable_id` bigint unsigned NOT NULL,
  `file_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_path` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mime_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `message_attachments_attachable_type_attachable_id_index` (`attachable_type`,`attachable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `message_reactions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `message_reactions` (
  `reaction_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `reaction_msg_id` bigint unsigned NOT NULL,
  `reaction_user_id` bigint unsigned NOT NULL,
  `reaction_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`reaction_id`),
  UNIQUE KEY `unique_user_message_reaction` (`reaction_msg_id`,`reaction_user_id`,`reaction_type`),
  KEY `message_reactions_reaction_msg_id_reaction_type_index` (`reaction_msg_id`,`reaction_type`),
  KEY `message_reactions_reaction_user_id_index` (`reaction_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `message_statuses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `message_statuses` (
  `status_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `status_msg_id` bigint unsigned NOT NULL,
  `status_user_id` bigint unsigned NOT NULL,
  `status_type` enum('sent','delivered','read') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'sent',
  `status_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`status_id`),
  UNIQUE KEY `unique_user_message_status` (`status_msg_id`,`status_user_id`,`status_type`),
  KEY `message_statuses_status_msg_id_status_type_index` (`status_msg_id`,`status_type`),
  KEY `message_statuses_status_user_id_status_timestamp_index` (`status_user_id`,`status_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `messages` (
  `msg_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `msg_conv_id` bigint unsigned NOT NULL,
  `msg_sender_id` bigint unsigned NOT NULL,
  `msg_content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `msg_type` enum('text','image','file','system') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text',
  `msg_attachment_path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `msg_attachment_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `msg_attachment_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `msg_attachment_size` int DEFAULT NULL,
  `msg_metadata` json DEFAULT NULL,
  `msg_is_edited` tinyint(1) NOT NULL DEFAULT '0',
  `msg_edited_at` timestamp NULL DEFAULT NULL,
  `msg_is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  `msg_deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`msg_id`),
  KEY `messages_msg_conv_id_created_at_index` (`msg_conv_id`,`created_at`),
  KEY `messages_msg_sender_id_created_at_index` (`msg_sender_id`,`created_at`),
  KEY `messages_msg_type_index` (`msg_type`),
  CONSTRAINT `messages_msg_conv_id_foreign` FOREIGN KEY (`msg_conv_id`) REFERENCES `conversations` (`conv_id`) ON DELETE CASCADE,
  CONSTRAINT `messages_msg_sender_id_foreign` FOREIGN KEY (`msg_sender_id`) REFERENCES `n_utilisateurs` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `methodepayement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `methodepayement` (
  `methpay_id` int unsigned NOT NULL AUTO_INCREMENT,
  `methpay_nom` varchar(50) NOT NULL,
  `methpay_opt` int NOT NULL,
  PRIMARY KEY (`methpay_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `modmat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `modmat` (
  `mm_id` int NOT NULL AUTO_INCREMENT,
  `mm_mod_id` int NOT NULL,
  `mm_mat_id` int NOT NULL,
  `mm_coef` decimal(3,1) DEFAULT NULL,
  `mm_session_id` int DEFAULT NULL,
  PRIMARY KEY (`mm_id`),
  KEY `mm_mod_id` (`mm_mod_id`),
  KEY `mm_mat_id` (`mm_mat_id`),
  KEY `mm_session_id` (`mm_session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `module`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `module` (
  `mod_id` int NOT NULL AUTO_INCREMENT,
  `mod_code` varchar(10) DEFAULT NULL,
  `mod_nom` varchar(100) NOT NULL,
  `mod_coef` int DEFAULT NULL,
  `mod_filiere_id` int NOT NULL,
  `mod_typeformation_id` int NOT NULL,
  `mod_annee_id` int DEFAULT NULL,
  `mod_visible` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`mod_id`),
  KEY `mod_filiere_id` (`mod_filiere_id`),
  KEY `mod_annee_id` (`mod_annee_id`),
  KEY `mod_typeformation_id` (`mod_typeformation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mois`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `mois` (
  `mois_id` int NOT NULL AUTO_INCREMENT,
  `mois_nom` varchar(20) NOT NULL,
  `mois_code` int NOT NULL,
  `mois_ordre` int NOT NULL,
  PRIMARY KEY (`mois_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `moyenne_emo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `moyenne_emo` (
  `moy_id` int NOT NULL AUTO_INCREMENT,
  `moy_emo` int DEFAULT NULL,
  `moy_ins_id` int DEFAULT NULL,
  `moy_note` float DEFAULT NULL,
  PRIMARY KEY (`moy_id`) USING BTREE,
  KEY `moy_emo` (`moy_emo`) USING BTREE,
  KEY `moy_ins_id` (`moy_ins_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_absences`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_absences` (
  `abs_id` int unsigned NOT NULL AUTO_INCREMENT,
  `abs_seance_id` int unsigned NOT NULL,
  `abs_uet_id` int unsigned NOT NULL,
  `abs_ins_id` int unsigned NOT NULL,
  `abs_type` enum('A','R') NOT NULL COMMENT 'Absence, Retard',
  `abs_est_justifie` int unsigned DEFAULT NULL,
  `abs_duree_retard` int unsigned DEFAULT NULL,
  `abs_justificatif` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `abs_modif_par` int DEFAULT NULL,
  `abs_date_modif` datetime DEFAULT NULL,
  PRIMARY KEY (`abs_id`),
  KEY `abs_seance_id` (`abs_seance_id`),
  KEY `abs_uet_id_abs_ins_id_abs_type` (`abs_uet_id`,`abs_ins_id`,`abs_type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_admission_criteres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_admission_criteres` (
  `ac_id` int unsigned NOT NULL AUTO_INCREMENT,
  `ac_adm_id` int NOT NULL,
  `ac_ca_id` int NOT NULL,
  `ac_sc_id` int NOT NULL COMMENT 'statuts criteres id',
  `ac_chemin` varchar(500) DEFAULT NULL,
  `ac_type` varchar(100) DEFAULT NULL,
  `ac_taille` decimal(20,2) NOT NULL DEFAULT '0.00',
  `ac_date_creation` datetime DEFAULT NULL,
  `ac_commentaire` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`ac_id`),
  KEY `ac_sc_id` (`ac_sc_id`),
  KEY `ac_adm_id` (`ac_adm_id`),
  KEY `ac_chemin` (`ac_chemin`),
  KEY `ac_ca_id` (`ac_ca_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_admission_miseaniveau`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_admission_miseaniveau` (
  `am_id` int unsigned NOT NULL AUTO_INCREMENT,
  `am_adm_id` int unsigned NOT NULL,
  `am_modules` varchar(200) NOT NULL DEFAULT '',
  `am_duree` varchar(100) NOT NULL,
  `am_appreciation` varchar(200) NOT NULL,
  PRIMARY KEY (`am_id`),
  KEY `am_adm_id` (`am_adm_id`),
  KEY `am_module_id` (`am_modules`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_admissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_admissions` (
  `adm_id` int unsigned NOT NULL AUTO_INCREMENT,
  `adm_date` date NOT NULL,
  `adm_seq` int unsigned NOT NULL DEFAULT '0',
  `adm_numero` varchar(20) NOT NULL,
  `adm_type` enum('M','S') NOT NULL DEFAULT 'M',
  `adm_supmti_id` int unsigned DEFAULT NULL,
  `adm_etudiant_id` int unsigned NOT NULL,
  `adm_formation_id` int unsigned NOT NULL,
  `adm_centre_id` int unsigned NOT NULL,
  `adm_centre_admin_id` int unsigned DEFAULT NULL,
  `adm_as_id` int unsigned NOT NULL,
  `adm_preins_id` int unsigned DEFAULT NULL,
  `adm_cne` varchar(20) DEFAULT NULL,
  `adm_cni` varchar(20) DEFAULT NULL,
  `adm_passport` varchar(20) DEFAULT NULL,
  `adm_cejour_date_exp` date DEFAULT NULL,
  `adm_situation` enum('N','R','P') DEFAULT NULL,
  `adm_diplomeacces` varchar(100) DEFAULT NULL,
  `adm_seriebac` varchar(100) DEFAULT NULL,
  `adm_anneebac` varchar(20) DEFAULT NULL,
  `adm_specialitebac` varchar(100) DEFAULT NULL,
  `adm_mentionbac` varchar(20) DEFAULT NULL,
  `adm_lieubac` varchar(100) DEFAULT NULL,
  `adm_premiereannee` varchar(20) DEFAULT NULL,
  `adm_handicape` enum('N','A','M','V','AM','AV','MV','T','XX') DEFAULT NULL,
  `adm_resident` enum('O','N') DEFAULT NULL,
  `adm_fonctionnaire` enum('O','N') DEFAULT NULL,
  `adm_bourse` decimal(20,2) DEFAULT NULL,
  `adm_mobilite` enum('O','N') DEFAULT NULL,
  `adm_documentsfournis` varchar(500) DEFAULT NULL,
  `adm_afournir` varchar(500) DEFAULT NULL,
  `adm_accordpeda` enum('V','O','R') DEFAULT NULL,
  `adm_commentairepeda` varchar(200) DEFAULT NULL,
  `adm_accordadmin` enum('V','O','R') DEFAULT NULL,
  `adm_commentaireadmin` varchar(200) DEFAULT NULL,
  `adm_statut_id` int unsigned NOT NULL DEFAULT '1',
  `adm_mise_a_niveau` tinyint unsigned NOT NULL DEFAULT '0',
  `adm_dossier_accept_chemin` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `adm_est_principale` tinyint DEFAULT '0',
  `adm_mode` enum('P','H') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `adm_localite_id` int unsigned DEFAULT NULL,
  `adm_ns_diplome` int unsigned DEFAULT NULL,
  `adm_site_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`adm_id`),
  KEY `adm_supmti_id` (`adm_supmti_id`),
  KEY `adm_etudiant_id` (`adm_etudiant_id`),
  KEY `adm_formation_id` (`adm_formation_id`),
  KEY `adm_centre_id` (`adm_centre_id`),
  KEY `adm_as_id` (`adm_as_id`),
  KEY `adm_preins_id` (`adm_preins_id`),
  KEY `adm_statut_id` (`adm_statut_id`),
  KEY `adm_centre_admin_id` (`adm_centre_admin_id`),
  KEY `adm_localite_id` (`adm_localite_id`),
  KEY `adm_mode` (`adm_mode`),
  KEY `adm_site_id` (`adm_site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_amendes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_amendes` (
  `id_amende` int NOT NULL AUTO_INCREMENT,
  `id_emprunt` int NOT NULL,
  `montant` decimal(10,2) NOT NULL,
  `raison` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `statut` enum('en_attente','payee','annulee') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'en_attente',
  `date_creation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `date_paiement` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id_amende`),
  KEY `id_emprunt` (`id_emprunt`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_author`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_author` (
  `author_id` int NOT NULL AUTO_INCREMENT,
  `author_name` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `author_status` enum('Actif','Inactif') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Actif',
  `author_created_on` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `author_updated_on` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`author_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_avis`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_avis` (
  `id_avis` int NOT NULL AUTO_INCREMENT,
  `id_utilisateur` int NOT NULL,
  `id_livre` int NOT NULL,
  `note` int DEFAULT NULL,
  `commentaire` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `date_creation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id_avis`),
  KEY `id_utilisateur` (`id_utilisateur`),
  KEY `id_livre` (`id_livre`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_batch`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_batch` (
  `bat_id` int NOT NULL AUTO_INCREMENT,
  `bat_desc` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `bat_criteres` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'Data to be used when running the job',
  `bat_date_prog` datetime NOT NULL,
  `bat_date_exec` datetime DEFAULT NULL,
  `bat_date_fin_exec` datetime DEFAULT NULL,
  `bat_statut` enum('N','E','S','R') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'N' COMMENT '''N : Pas encore'' , ''E : encours'', ''S : success'', ''R : error''',
  `bat_nbr_exec` int unsigned DEFAULT '0',
  `bat_job_id` int NOT NULL,
  PRIMARY KEY (`bat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_budgets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_budgets` (
  `bud_id` int unsigned NOT NULL AUTO_INCREMENT,
  `bud_libelle` varchar(300) NOT NULL,
  `bud_as_id` int unsigned NOT NULL,
  `bud_centre_id` int unsigned NOT NULL,
  `bud_definitif` tinyint unsigned NOT NULL,
  PRIMARY KEY (`bud_id`),
  KEY `bud_as_id` (`bud_as_id`),
  KEY `bud_centre_id` (`bud_centre_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_calendrier_pedagogiques`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_calendrier_pedagogiques` (
  `cal_id` int NOT NULL AUTO_INCREMENT,
  `cal_annee_scolaire` int NOT NULL,
  `cal_centre` int NOT NULL,
  `cal_session` int NOT NULL,
  `cal_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  PRIMARY KEY (`cal_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_categorie_livres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_categorie_livres` (
  `id_categorie` int NOT NULL AUTO_INCREMENT,
  `nom_categorie` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci,
  PRIMARY KEY (`id_categorie`),
  UNIQUE KEY `nom_categorie` (`nom_categorie`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_categories_video`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_categories_video` (
  `cat_id` int NOT NULL AUTO_INCREMENT,
  `cat_nom` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`cat_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_centre_formations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_centre_formations` (
  `cfm_id` int unsigned NOT NULL AUTO_INCREMENT,
  `cfm_centre_id` int unsigned NOT NULL,
  `cfm_for_id` int unsigned NOT NULL,
  PRIMARY KEY (`cfm_id`),
  KEY `cfm_centre_id` (`cfm_centre_id`),
  KEY `cfm_for_id` (`cfm_for_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_comptes_societe`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_comptes_societe` (
  `cs_id` int unsigned NOT NULL AUTO_INCREMENT,
  `cs_numero` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cs_rib` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cs_agence` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `cs_banque_id` int unsigned NOT NULL,
  `cs_ville_id` int unsigned NOT NULL,
  `cs_centre_id` int unsigned NOT NULL,
  `cs_principal` enum('O','N') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'N',
  PRIMARY KEY (`cs_id`),
  KEY `cs_banque_id` (`cs_banque_id`),
  KEY `cs_ville_id` (`cs_ville_id`),
  KEY `cs_centre_id` (`cs_centre_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_criteres_access`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_criteres_access` (
  `ca_id` int unsigned NOT NULL AUTO_INCREMENT,
  `ca_nom` varchar(500) NOT NULL,
  `ca_libelle` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `ca_abbr` varchar(50) NOT NULL,
  `ca_index` char(2) NOT NULL DEFAULT '',
  `ca_visibilite` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'visible pour l''étudiant',
  `ca_est_imprime` tinyint(1) NOT NULL DEFAULT '1',
  `ca_estobligatoire` tinyint NOT NULL DEFAULT '0',
  `ca_niv_min` tinyint NOT NULL DEFAULT '0',
  `ca_niv_max` tinyint NOT NULL DEFAULT '0',
  `ca_scope` enum('T','E','M') NOT NULL COMMENT 'Indique à quelle nationalité est appliquée ce critère : T : Toute, E: Etrangère, M; Maricaine',
  PRIMARY KEY (`ca_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_deliberations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_deliberations` (
  `del_id` int NOT NULL AUTO_INCREMENT,
  `del_status` enum('P','F','C') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'P' COMMENT 'P: prevu , F:faite ,C:Confirmer',
  `del_classe_id` int DEFAULT NULL,
  `del_date_prevu` datetime DEFAULT NULL,
  `del_date_effectuer` timestamp NULL DEFAULT NULL,
  `del_commentaire` char(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `del_annee` int DEFAULT NULL,
  `del_semestre` int DEFAULT NULL,
  `del_chemin` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `del_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Archivage (0 = non archivé, 1 = archivé)',
  PRIMARY KEY (`del_id`),
  KEY `del_classe_id` (`del_classe_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_demande_commentaires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_demande_commentaires` (
  `cd_id` int unsigned NOT NULL AUTO_INCREMENT,
  `cd_demande_id` int unsigned NOT NULL,
  `cd_user_id` int unsigned NOT NULL,
  `cd_date_creation` datetime NOT NULL,
  `cd_commentaire` varchar(1000) NOT NULL DEFAULT '',
  `cd_date_modification` datetime DEFAULT NULL,
  `cd_type` enum('I','P') DEFAULT NULL COMMENT 'I: Interne (visible uniquement pour le personnel de l''Admin), P: Public (visible pour les étudiants et Tuteurs)',
  PRIMARY KEY (`cd_id`),
  KEY `cd_demande_id` (`cd_demande_id`),
  KEY `cd_user_id` (`cd_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_demandes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_demandes` (
  `dem_id` int unsigned NOT NULL AUTO_INCREMENT,
  `dem_statut_id` int unsigned NOT NULL DEFAULT '1',
  `dem_ins_id` int unsigned NOT NULL,
  `dem_user_id` int unsigned DEFAULT '0',
  `dem_createur_id` int unsigned DEFAULT NULL,
  `dem_type_id` int unsigned NOT NULL,
  `dem_type_recl_id` int unsigned DEFAULT NULL,
  `dem_date_creation` datetime NOT NULL,
  `dem_objet` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dem_details` varchar(800) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dem_date_souhaitee` datetime DEFAULT NULL,
  `dem_date_prevision` datetime DEFAULT NULL,
  `dem_typedoc_id` int unsigned DEFAULT NULL,
  `dem_modele_id` int unsigned DEFAULT NULL,
  `dem_date_prise_encompte` datetime DEFAULT NULL,
  `dem_dispo` datetime DEFAULT NULL,
  `dem_livraison` datetime DEFAULT NULL,
  `dem_fichier` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dem_fichier_type` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dem_ticket_id` int unsigned DEFAULT NULL,
  `dem_contenu` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `dem_site_id` int DEFAULT NULL,
  `dem_rec_prove_chemin` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`dem_id`) USING BTREE,
  KEY `dem_ins_id` (`dem_ins_id`) USING BTREE,
  KEY `dem_user_id` (`dem_user_id`) USING BTREE,
  KEY `dem_type_id` (`dem_type_id`) USING BTREE,
  KEY `dem_typedoc_id` (`dem_typedoc_id`) USING BTREE,
  KEY `dem_modele_id` (`dem_modele_id`) USING BTREE,
  KEY `dem_createur_id` (`dem_createur_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_diplomes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_diplomes` (
  `dip_id` int unsigned NOT NULL AUTO_INCREMENT,
  `dip_nom` varchar(100) NOT NULL DEFAULT '',
  `dip_abbr` varchar(20) NOT NULL DEFAULT '',
  `dip_nbannees` int unsigned NOT NULL DEFAULT '0',
  `dip_niveau_apresbac` int unsigned NOT NULL DEFAULT '0',
  `dip_gd_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'groupement_diplomes',
  PRIMARY KEY (`dip_id`),
  UNIQUE KEY `dip_abbr` (`dip_abbr`),
  KEY `dip_gd_id` (`dip_gd_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_diplomes_acces`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_diplomes_acces` (
  `da_id` int unsigned NOT NULL AUTO_INCREMENT,
  `da_preins_id` int unsigned NOT NULL,
  `da_type_diplome_id` int unsigned DEFAULT NULL,
  `da_specialite` varchar(300) DEFAULT NULL,
  `da_mention` varchar(20) DEFAULT NULL,
  `da_ville` varchar(50) DEFAULT NULL COMMENT 'this will be deleted( we will use a list of coutries instead)',
  `da_pays_id` int unsigned DEFAULT NULL,
  `da_nom_etablissement` varchar(100) DEFAULT NULL,
  `da_ville_id` int unsigned DEFAULT NULL,
  `da_type_etablissement` varchar(15) DEFAULT NULL,
  `da_annee` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`da_id`) USING BTREE,
  KEY `da_preins_id` (`da_preins_id`),
  KEY `pays_id` (`da_pays_id`) USING BTREE,
  KEY `ville_id` (`da_ville_id`) USING BTREE,
  KEY `diplome_id` (`da_type_diplome_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_diplomes_laureats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_diplomes_laureats` (
  `dplm_id` int NOT NULL AUTO_INCREMENT,
  `dplm_inscription_id` int NOT NULL,
  `dplm_chemin` varchar(255) DEFAULT NULL COMMENT 'Chemin du fichier',
  `dplm_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Archivage (0 = non archivé, 1 = archivé)',
  PRIMARY KEY (`dplm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_domaines`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_domaines` (
  `dom_id` int unsigned NOT NULL AUTO_INCREMENT,
  `dom_nom` varchar(100) NOT NULL,
  PRIMARY KEY (`dom_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_dossiers_acceptation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_dossiers_acceptation` (
  `da_id` int unsigned NOT NULL AUTO_INCREMENT,
  `da_inscription_id` int NOT NULL,
  `da_as_id` int NOT NULL,
  `da_classe_id` int NOT NULL,
  `da_chemin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `da_est_archive` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`da_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table des dossiers d''acceptation';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_edt`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_edt` (
  `edt_id` int unsigned NOT NULL AUTO_INCREMENT,
  `edt_classe_id` int unsigned NOT NULL,
  `edt_as_id` int unsigned NOT NULL,
  `edt_centre_id` int unsigned DEFAULT NULL,
  `edt_sem_id` int unsigned NOT NULL,
  `edt_type_id` int NOT NULL DEFAULT (0) COMMENT 'Cours, Exam',
  `edt_mode` enum('P','H') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'P' COMMENT 'Présentiel, Hybride',
  `edt_statut` enum('P','D') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Provisoire, Définitif',
  `edt_nom` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `edt_date_validite` date DEFAULT NULL,
  `edt_type_adm` enum('M','S') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'M',
  `edt_est_decale` tinyint DEFAULT '0',
  `edt_calender_id` int DEFAULT NULL,
  `edt_chemin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Chemin du fichier',
  `edt_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Archivage (0 = non archivé, 1 = archivé)',
  PRIMARY KEY (`edt_id`),
  KEY `edt_classe_id` (`edt_classe_id`),
  KEY `edt_as_id` (`edt_as_id`),
  KEY `edt_session_id` (`edt_sem_id`) USING BTREE,
  KEY `edt_calender_id` (`edt_calender_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_edt_unites`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_edt_unites` (
  `uet_id` int unsigned NOT NULL AUTO_INCREMENT,
  `uet_edt_id` int unsigned NOT NULL,
  `uet_salle_id` int unsigned DEFAULT NULL,
  `uet_emo_id` int unsigned NOT NULL,
  `uet_prof_id` int unsigned NOT NULL,
  `uet_hdeb` time DEFAULT NULL,
  `uet_hfin` time DEFAULT NULL,
  `uet_duree` smallint NOT NULL,
  `uet_jour` int unsigned NOT NULL,
  `uet_date_deb` date NOT NULL,
  `uet_date_fin` date NOT NULL,
  `uet_groupe_id` int unsigned DEFAULT NULL,
  `uet_remarque` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`uet_id`),
  KEY `uet_edt_id` (`uet_edt_id`),
  KEY `uet_salle_id` (`uet_salle_id`),
  KEY `uet_emo_id` (`uet_emo_id`),
  KEY `uet_prof_id` (`uet_prof_id`),
  KEY `uet_groupe_id` (`uet_groupe_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_elements_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_elements_modules` (
  `emo_id` int unsigned NOT NULL AUTO_INCREMENT,
  `emo_classe_id` int unsigned NOT NULL,
  `emo_mod_id` int unsigned NOT NULL,
  `emo_mod_index` int NOT NULL,
  `emo_mat_id` int unsigned NOT NULL,
  `emo_sem_id` int unsigned NOT NULL,
  `emo_prof_cours_id` int unsigned DEFAULT NULL,
  `emo_prof_td_id` int unsigned DEFAULT NULL,
  `emo_prof_p_id` int unsigned DEFAULT NULL COMMENT 'Prof PrÃ©sentiel',
  `emo_prof_h_id` int unsigned DEFAULT NULL COMMENT 'Prof Hybride',
  `emo_coef` decimal(20,2) unsigned NOT NULL,
  `emo_nbheures` int unsigned NOT NULL,
  `emo_type` enum('MOD','PFE','PFA') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `emo_visible_pv` tinyint unsigned DEFAULT '1',
  `emo_est_enseigne` tinyint unsigned DEFAULT '1',
  `emo_last_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`emo_id`),
  KEY `emo_mod_id` (`emo_mod_id`),
  KEY `emo_mat_id` (`emo_mat_id`),
  KEY `emo_classe_id` (`emo_classe_id`),
  KEY `emo_sem_id` (`emo_sem_id`),
  KEY `emo_prof_principal` (`emo_prof_cours_id`) USING BTREE,
  KEY `emo_prof_bkp` (`emo_prof_td_id`) USING BTREE,
  KEY `emo_p_prof_id` (`emo_prof_p_id`) USING BTREE,
  KEY `emo_h_prof_id` (`emo_prof_h_id`) USING BTREE,
  KEY `emo_visible_pv` (`emo_visible_pv`),
  KEY `emo_est_enseigne` (`emo_est_enseigne`),
  KEY `emo_last_id` (`emo_last_id`),
  KEY `emo_mod_index` (`emo_mod_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_emprunts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_emprunts` (
  `id_emprunt` int NOT NULL AUTO_INCREMENT,
  `id_utilisateur` int DEFAULT NULL,
  `nom_externe` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tel_externe` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_externe` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `identite_externe` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_exemplaire` int NOT NULL,
  `date_emprunt` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `date_retour_prevue` timestamp NOT NULL,
  `date_retour_effective` timestamp NULL DEFAULT NULL,
  `statut` enum('actif','rendu','en_retard','perdu') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'actif',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id_emprunt`),
  KEY `id_utilisateur` (`id_utilisateur`),
  KEY `id_exemplaire` (`id_exemplaire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_encadrants_projets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_encadrants_projets` (
  `ep_id` int unsigned NOT NULL AUTO_INCREMENT,
  `ep_emo_id` int unsigned NOT NULL,
  `ep_gp_id` int unsigned NOT NULL,
  `ep_prof_id` int unsigned NOT NULL,
  PRIMARY KEY (`ep_id`),
  KEY `ep_prof_id` (`ep_prof_id`),
  KEY `ep_emo_id` (`ep_emo_id`),
  KEY `ep_gs_id` (`ep_gp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_etudiants`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_etudiants` (
  `etud_id` int NOT NULL AUTO_INCREMENT,
  `etud_nom` varchar(50) NOT NULL,
  `etud_prenom` varchar(50) NOT NULL,
  `etud_nom_ar` varchar(50) DEFAULT NULL,
  `etud_prenom_ar` varchar(50) DEFAULT NULL,
  `etud_sexe` char(1) NOT NULL,
  `etud_cni` varchar(20) DEFAULT NULL,
  `etud_passport` varchar(20) DEFAULT NULL,
  `etud_datenaiss` date DEFAULT NULL,
  `etud_lieunaiss` varchar(50) DEFAULT NULL,
  `etud_lieunaiss_ar` varchar(50) DEFAULT NULL,
  `etud_adresse` varchar(200) DEFAULT NULL,
  `etud_ville_id` int unsigned DEFAULT NULL,
  `etud_nat_id` int unsigned NOT NULL,
  `etud_email` varchar(100) DEFAULT NULL,
  `etud_tel` varchar(50) DEFAULT NULL,
  `etud_status` tinyint(1) DEFAULT '0',
  `etud_user_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`etud_id`),
  KEY `etud_ville_id` (`etud_ville_id`),
  KEY `etud_nat_id` (`etud_nat_id`),
  KEY `etud_user_id` (`etud_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_examens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_examens` (
  `exam_id` int unsigned NOT NULL AUTO_INCREMENT,
  `exam_type_id` int unsigned NOT NULL,
  `exam_index` int unsigned NOT NULL,
  `exam_prof_id` int unsigned DEFAULT NULL,
  `exam_emo_id` int unsigned NOT NULL,
  `exam_sem_id` int unsigned NOT NULL,
  `exam_as_id` int unsigned NOT NULL,
  `exam_mode` enum('P','H') NOT NULL DEFAULT 'P',
  `exam_date` datetime NOT NULL,
  `exam_date_notes` datetime DEFAULT NULL,
  `exam_coef` double DEFAULT NULL,
  `exam_seance_id` int unsigned DEFAULT NULL,
  `exam_last_id` int unsigned DEFAULT NULL,
  `exam_chemin` varchar(255) DEFAULT NULL COMMENT 'Chemin du fichier',
  `exam_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Archivage (0 = non archivé, 1 = archivé)',
  `exam_classe_id` int unsigned DEFAULT NULL COMMENT 'Identifiant de la classe',
  `exam_session` enum('1','2') NOT NULL COMMENT 'Session de l''examen (1 = normale, 2 = rattrapage)',
  PRIMARY KEY (`exam_id`),
  KEY `exam_prof_id` (`exam_prof_id`),
  KEY `exam_emo_id` (`exam_emo_id`),
  KEY `exam_sem_id` (`exam_sem_id`),
  KEY `exam_index` (`exam_index`),
  KEY `exam_type_id` (`exam_type_id`),
  KEY `exam_seance_id` (`exam_seance_id`),
  KEY `exam_last_id` (`exam_last_id`),
  KEY `exam_as_id` (`exam_as_id`),
  KEY `exam_mode` (`exam_mode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_exemplaires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_exemplaires` (
  `id_exemplaire` int NOT NULL AUTO_INCREMENT,
  `id_livre` int NOT NULL,
  `code_barre` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `statut` enum('disponible','emprunte','reserve','maintenance') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'disponible',
  `etat` enum('neuf','bon','moyen','mauvais') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'bon',
  `date_acquisition` date DEFAULT NULL,
  `date_derniere_maintenance` date DEFAULT NULL,
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id_exemplaire`),
  UNIQUE KEY `code_barre` (`code_barre`),
  KEY `id_livre` (`id_livre`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_filiere_signataires`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_filiere_signataires` (
  `fs_id` int unsigned NOT NULL AUTO_INCREMENT,
  `fs_filiere_id` int unsigned NOT NULL,
  `fs_prof_id` int unsigned NOT NULL,
  `fs_diplome_id` int unsigned DEFAULT NULL,
  `fs_qualite` enum('CD','CF','PR') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'CD : Chef de departement | CF : Chef filière | PR: Professeur ',
  PRIMARY KEY (`fs_id`),
  KEY `fs_filiere_id` (`fs_filiere_id`),
  KEY `fs_prof_id` (`fs_prof_id`),
  KEY `fs_diplome_id` (`fs_diplome_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_filieres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_filieres` (
  `fil_id` int unsigned NOT NULL AUTO_INCREMENT,
  `fil_nom` varchar(100) NOT NULL DEFAULT '',
  `fil_nom_ar` varchar(200) DEFAULT NULL,
  `fil_abbr` varchar(20) NOT NULL DEFAULT '',
  `fil_dom_id` int unsigned NOT NULL,
  PRIMARY KEY (`fil_id`),
  UNIQUE KEY `fil_abbr` (`fil_abbr`),
  KEY `fil_dom_id` (`fil_dom_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_formations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_formations` (
  `for_id` int unsigned NOT NULL AUTO_INCREMENT,
  `for_abbr` varchar(30) NOT NULL,
  `for_nom` varchar(200) NOT NULL,
  `for_diplome_id` int unsigned NOT NULL,
  `for_filiere_id` int unsigned NOT NULL,
  `for_est_accredite` enum('O','N') NOT NULL DEFAULT 'O',
  `for_langue` varchar(10) NOT NULL DEFAULT 'Fr',
  `for_option_id` int unsigned DEFAULT NULL,
  `for_codefiliere` varchar(50) DEFAULT NULL,
  `for_codeoption` varchar(50) DEFAULT NULL,
  `for_asdebut` int unsigned DEFAULT NULL,
  `for_asfin` int unsigned DEFAULT NULL,
  `for_asdebut_eff` int unsigned DEFAULT NULL,
  `for_asfin_eff` int unsigned DEFAULT NULL,
  `for_centre_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`for_id`),
  UNIQUE KEY `for_abbr_for_centre_id` (`for_abbr`,`for_centre_id`),
  KEY `for_diplome_id` (`for_diplome_id`),
  KEY `for_filiere_id` (`for_filiere_id`),
  KEY `for_option_id` (`for_option_id`),
  KEY `for_asdebut` (`for_asdebut`),
  KEY `for_asfin` (`for_asfin`),
  KEY `for_asdebut_eff` (`for_asdebut_eff`),
  KEY `for_asfin_eff` (`for_asfin_eff`),
  KEY `for_centre_id` (`for_centre_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_fraisconvenu`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_fraisconvenu` (
  `fcv_id` int unsigned NOT NULL AUTO_INCREMENT,
  `fcv_montant` decimal(10,2) NOT NULL,
  `fcv_sompayee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `fcv_nbperiodes` int unsigned NOT NULL,
  `fcv_mtperiode` decimal(10,2) NOT NULL,
  `fcv_typefrais_id` int unsigned NOT NULL,
  `fcv_ins_id` int unsigned NOT NULL,
  `fcv_typeperiode_id` int unsigned NOT NULL,
  `fcv_typefrais_ordre` int unsigned DEFAULT '0',
  PRIMARY KEY (`fcv_id`),
  KEY `fcv_ins_id` (`fcv_ins_id`),
  KEY `fcv_typefrais_id` (`fcv_typefrais_id`),
  KEY `fcv_modep_id` (`fcv_typeperiode_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_groupecritere_lignes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_groupecritere_lignes` (
  `gcl_id` int unsigned NOT NULL AUTO_INCREMENT,
  `gcl_gc_id` int unsigned DEFAULT '0',
  `gcl_ca_id` int unsigned DEFAULT '0',
  `gcl_ordre` int unsigned DEFAULT '0',
  `gcl_estobligatoire` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`gcl_id`),
  KEY `gcl_gc_id` (`gcl_gc_id`),
  KEY `gcl_ca_id` (`gcl_ca_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_groupement_diplomes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_groupement_diplomes` (
  `gd_id` int unsigned NOT NULL AUTO_INCREMENT,
  `gd_abbr` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `gd_nom` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `gd_ordre` tinyint NOT NULL DEFAULT (0),
  PRIMARY KEY (`gd_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_groupes_criteres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_groupes_criteres` (
  `gc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `gc_nom` varchar(200) NOT NULL,
  `gc_clas_id` int unsigned NOT NULL DEFAULT '0',
  `gc_nat_id` int unsigned DEFAULT '0',
  PRIMARY KEY (`gc_id`),
  KEY `gc_clas_id` (`gc_clas_id`),
  KEY `gc_nat_id` (`gc_nat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_groupes_projets`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_groupes_projets` (
  `gp_id` int unsigned NOT NULL AUTO_INCREMENT,
  `gp_nom` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`gp_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_inscriptions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_inscriptions` (
  `ins_id` int unsigned NOT NULL AUTO_INCREMENT,
  `ins_seq` int unsigned NOT NULL DEFAULT '0',
  `ins_numero` varchar(20) NOT NULL,
  `ins_date` datetime DEFAULT NULL,
  `ins_etudiant_id` int unsigned DEFAULT NULL,
  `ins_adm_id` int unsigned NOT NULL,
  `ins_classe_id` int unsigned NOT NULL,
  `ins_as_id` int unsigned NOT NULL COMMENT 'annee scolaire id',
  `ins_statut_id` int NOT NULL DEFAULT '-1' COMMENT 'before table creation',
  `ins_tmp_id` int unsigned DEFAULT NULL,
  `ins_grp_id` int unsigned DEFAULT NULL,
  `ins_gp_id` int unsigned DEFAULT NULL COMMENT 'groupe projet',
  `ins_mode` enum('P','H') NOT NULL,
  `ins_note_est_affiche` tinyint NOT NULL DEFAULT '1',
  PRIMARY KEY (`ins_id`),
  KEY `ins_etudiant_id` (`ins_etudiant_id`),
  KEY `ins_adm_id` (`ins_adm_id`),
  KEY `ins_classe_id` (`ins_classe_id`),
  KEY `ins_as_id` (`ins_as_id`),
  KEY `ins_statut_id` (`ins_statut_id`),
  KEY `ins_tmp-id` (`ins_tmp_id`) USING BTREE,
  KEY `ins_grp_id` (`ins_grp_id`),
  KEY `ins_gp_id` (`ins_gp_id`),
  KEY `index_ins_mode` (`ins_mode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_inscriptions_archive`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_inscriptions_archive` (
  `ins_id` int NOT NULL,
  `ins_seq` int unsigned NOT NULL DEFAULT '0',
  `ins_numero` varchar(20) NOT NULL,
  `ins_date` datetime DEFAULT NULL,
  `ins_etudiant_id` int unsigned DEFAULT NULL,
  `ins_adm_id` int unsigned NOT NULL,
  `ins_classe_id` int unsigned NOT NULL,
  `ins_as_id` int unsigned NOT NULL COMMENT 'annee scolaire id',
  `ins_statut_id` int NOT NULL DEFAULT '-1' COMMENT 'before table creation',
  `ins_tmp_id` int unsigned DEFAULT NULL,
  `ins_grp_id` int unsigned DEFAULT NULL,
  `ins_date_archive` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ins_id`),
  KEY `ins_etudiant_id` (`ins_etudiant_id`),
  KEY `ins_adm_id` (`ins_adm_id`),
  KEY `ins_classe_id` (`ins_classe_id`),
  KEY `ins_as_id` (`ins_as_id`),
  KEY `ins_statut_id` (`ins_statut_id`),
  KEY `ins_tmp-id` (`ins_tmp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_job`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_job` (
  `job_id` int NOT NULL AUTO_INCREMENT,
  `job_nom` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `job_url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`job_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_jours_feries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_jours_feries` (
  `jf_id` int unsigned NOT NULL AUTO_INCREMENT,
  `jf_nom` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `jf_date_deb` date NOT NULL,
  `jf_date_fin` date NOT NULL,
  `jf_as_id` int unsigned NOT NULL,
  PRIMARY KEY (`jf_id`),
  KEY `jf_as_id` (`jf_as_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_lignes_operation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_lignes_operation` (
  `lop_id` int unsigned NOT NULL AUTO_INCREMENT,
  `lop_op_id` int unsigned NOT NULL,
  `lop_cs_id` int unsigned NOT NULL COMMENT 'Compte Société',
  `lop_methpay_id` int unsigned NOT NULL,
  `lop_montant` decimal(20,2) NOT NULL DEFAULT '0.00',
  `lop_piece_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`lop_id`),
  KEY `lop_op_id` (`lop_op_id`),
  KEY `lop_cs_id` (`lop_cs_id`),
  KEY `lop_methpay_id` (`lop_methpay_id`),
  KEY `lop_piece_id` (`lop_piece_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_listes_absences`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_listes_absences` (
  `abs_id` int unsigned NOT NULL AUTO_INCREMENT,
  `abs_as_id` int unsigned NOT NULL,
  `abs_exam_id` int unsigned NOT NULL,
  `abs_module_id` int unsigned NOT NULL,
  `abs_classe_id` int unsigned NOT NULL,
  `abs_semestre_id` tinyint(1) NOT NULL DEFAULT '1',
  `abs_session` enum('1','2') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Session de l''examen (1 = normale, 2 = rattrapage)',
  `abs_chemin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `abs_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Archivage (0 = non archivé, 1 = archivé)',
  PRIMARY KEY (`abs_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_listes_laureats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_listes_laureats` (
  `liste_id` int NOT NULL AUTO_INCREMENT,
  `liste_as_id` int NOT NULL,
  `liste_classe_id` int NOT NULL,
  `liste_chemin` varchar(255) DEFAULT NULL,
  `liste_est_archive` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`liste_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_livre`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_livre` (
  `id_livre` int NOT NULL AUTO_INCREMENT,
  `titre` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `auteur` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `entreprise_accueil` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `encadrant_interne` int DEFAULT NULL,
  `etudiants_premier` int DEFAULT NULL,
  `etudiants_deuxieme` int DEFAULT NULL,
  `etudiants_troisieme` int DEFAULT NULL,
  `isbn` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `date_publication` date DEFAULT NULL,
  `author_id` int DEFAULT NULL,
  `category_id` int DEFAULT NULL,
  `quantite_totale` int NOT NULL,
  `quantite_disponible` int NOT NULL,
  `image_livre` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `statut` enum('disponible','emprunté','en_reparation') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 'disponible',
  `mots_cle` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `resume` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `centre` int DEFAULT NULL,
  `site` int DEFAULT NULL,
  `chemin` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id_livre`),
  KEY `author_id` (`author_id`),
  KEY `category_id` (`category_id`),
  KEY `encadrant_interne` (`encadrant_interne`),
  KEY `etudiants_premier` (`etudiants_premier`),
  KEY `etudiants_deuxieme` (`etudiants_deuxieme`),
  KEY `etudiants_troisieme` (`etudiants_troisieme`),
  KEY `centre` (`centre`),
  KEY `site` (`site`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_livre_auteurs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_livre_auteurs` (
  `id_livre` int NOT NULL,
  `id_auteur` int NOT NULL,
  PRIMARY KEY (`id_livre`,`id_auteur`),
  KEY `id_auteur` (`id_auteur`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_localites`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_localites` (
  `loc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `loc_nom` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`loc_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_mail_list`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_mail_list` (
  `ml_id` int unsigned NOT NULL AUTO_INCREMENT,
  `ml_nom` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`ml_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Vérification d''adresse mail';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_matieres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_matieres` (
  `mat_id` int unsigned NOT NULL AUTO_INCREMENT,
  `mat_abbr` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `mat_nom` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`mat_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_menus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_menus` (
  `menu_id` int unsigned NOT NULL AUTO_INCREMENT,
  `menu_nom` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `menu_url` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `menu_icon` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
  `menu_ordre` int NOT NULL,
  `menu_parent` int DEFAULT NULL,
  `menu_actif` tinyint(1) NOT NULL,
  `menu_type` enum('F','N') NOT NULL,
  `menu_niveau` tinyint NOT NULL DEFAULT '1',
  `menu_app` tinyint NOT NULL DEFAULT '1',
  PRIMARY KEY (`menu_id`) USING BTREE,
  KEY `menu_parent` (`menu_parent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_modeles_documents`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_modeles_documents` (
  `mdoc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `mdoc_nom` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `mdoc_contenu` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `mdoc_typedoc_id` int unsigned NOT NULL,
  PRIMARY KEY (`mdoc_id`),
  KEY `mdoc_typedoc_id` (`mdoc_typedoc_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_modules`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_modules` (
  `mod_id` int unsigned NOT NULL AUTO_INCREMENT,
  `mod_abbr` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `mod_nom` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `mod_cordinateur_id` int DEFAULT NULL,
  PRIMARY KEY (`mod_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_niveaux`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_niveaux` (
  `niv_id` int unsigned NOT NULL,
  `niv_nom` varchar(50) NOT NULL DEFAULT '',
  PRIMARY KEY (`niv_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_notifications` (
  `id_notification` int NOT NULL AUTO_INCREMENT,
  `id_utilisateur` int NOT NULL,
  `type` enum('date_retour','reservation','amende','systeme') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `est_lu` tinyint(1) DEFAULT '0',
  `date_creation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id_notification`),
  KEY `id_utilisateur` (`id_utilisateur`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_operations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_operations` (
  `op_id` int unsigned NOT NULL AUTO_INCREMENT,
  `op_date` datetime NOT NULL,
  `op_montant` decimal(20,2) NOT NULL,
  `op_type` enum('E','S') NOT NULL,
  `op_libelle` varchar(300) NOT NULL,
  `op_user_id` int unsigned NOT NULL,
  `op_rb_id` int unsigned NOT NULL,
  `op_facture` varchar(20) DEFAULT NULL,
  `op_recu_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`op_id`),
  KEY `op_user_id` (`op_user_id`),
  KEY `op_rb_id` (`op_rb_id`),
  KEY `op_facture` (`op_facture`),
  KEY `op_recu_id` (`op_recu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_options`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_options` (
  `opt_id` int unsigned NOT NULL AUTO_INCREMENT,
  `opt_nom` varchar(100) NOT NULL,
  `opt_nom_ar` varchar(200) DEFAULT NULL,
  `opt_abbr` varchar(20) NOT NULL,
  `opt_filiere_id` int unsigned NOT NULL,
  PRIMARY KEY (`opt_id`),
  UNIQUE KEY `opt_abbr` (`opt_abbr`),
  KEY `opt_filiere_id` (`opt_filiere_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_periodes_convenues`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_periodes_convenues` (
  `pcv_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pcv_fcv_id` int unsigned NOT NULL,
  `pcv_periode_id` int unsigned NOT NULL,
  `pcv_convenu` decimal(10,2) NOT NULL,
  PRIMARY KEY (`pcv_id`),
  KEY `pcv_periode_id` (`pcv_periode_id`),
  KEY `pcv_fcv_id` (`pcv_fcv_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_periodes_payees`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_periodes_payees` (
  `pp_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pp_pcv_id` int unsigned NOT NULL,
  `pp_montant` decimal(10,2) NOT NULL,
  `pp_recu_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`pp_id`),
  KEY `pp_recu_id` (`pp_recu_id`),
  KEY `pp_fcv_id` (`pp_pcv_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_permissions` (
  `perm_id` int unsigned NOT NULL AUTO_INCREMENT,
  `perm_nom` varchar(100) DEFAULT NULL,
  `perm_type` enum('Menu','Action','Option') DEFAULT NULL,
  `perm_menu_id` int DEFAULT NULL,
  `perm_app` tinyint DEFAULT NULL,
  PRIMARY KEY (`perm_id`),
  KEY `perm_menu_id` (`perm_menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_personnel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_personnel` (
  `dir_id` int NOT NULL AUTO_INCREMENT,
  `dir_civilite` varchar(8) DEFAULT NULL,
  `dir_nom` varchar(50) NOT NULL,
  `dir_prenom` varchar(50) NOT NULL,
  `dir_sexe` char(1) NOT NULL,
  `dir_cin` varchar(20) DEFAULT NULL,
  `dir_datenaiss` date DEFAULT NULL,
  `dir_lieunaiss` varchar(50) DEFAULT NULL,
  `dir_adresse` varchar(200) DEFAULT NULL,
  `dir_ville_id` int unsigned DEFAULT NULL,
  `dir_email` varchar(100) DEFAULT NULL,
  `dir_tel` varchar(50) DEFAULT NULL,
  `dir_cnss` varchar(20) DEFAULT NULL,
  `dir_date_service` date DEFAULT NULL,
  `dir_date_depart` date DEFAULT NULL,
  `dir_user_id` int unsigned DEFAULT NULL,
  `dir_site_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`dir_id`) USING BTREE,
  KEY `pers_user_id` (`dir_user_id`) USING BTREE,
  KEY `pers_ville_id` (`dir_ville_id`) USING BTREE,
  KEY `dir_site_id` (`dir_site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_personnel_centres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_personnel_centres` (
  `pc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pc_pers_id` int unsigned NOT NULL,
  `pc_centre_id` int unsigned NOT NULL,
  `pc_centre_defaut` tinyint unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`pc_id`),
  KEY `pc_centre_id` (`pc_centre_id`),
  KEY `pc_dir_id` (`pc_pers_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_pfc`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_pfc` (
  `pfc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pfc_inscription_id` int NOT NULL,
  `pfc_as_id` int NOT NULL,
  `pfc_classe_id` int NOT NULL,
  `pfc_chemin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pfc_est_archive` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`pfc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table des projets de fin d’études';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_pfe`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_pfe` (
  `pfe_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pfe_inscription_id` int NOT NULL,
  `pfe_as_id` int NOT NULL,
  `pfe_classe_id` int NOT NULL,
  `pfe_chemin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pfe_est_archive` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`pfe_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table des projets de fin d’études';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_pieces`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_pieces` (
  `pc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pc_reference` varchar(50) DEFAULT NULL,
  `pc_date` date DEFAULT NULL,
  `pc_type_id` int unsigned NOT NULL,
  `pc_cs_id` int unsigned DEFAULT NULL,
  `pc_montant` decimal(20,2) NOT NULL DEFAULT '0.00',
  `pc_date_reception` datetime DEFAULT NULL,
  `pc_date_remise` datetime DEFAULT NULL,
  `pc_titulaire` varchar(100) DEFAULT NULL,
  `pc_commentaire` varchar(300) DEFAULT NULL,
  `pc_capture` varchar(300) DEFAULT '',
  PRIMARY KEY (`pc_id`),
  KEY `pc_type_id` (`pc_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_preinscription_criteres`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_preinscription_criteres` (
  `pc_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pc_preins_id` int NOT NULL,
  `pc_ca_id` int NOT NULL,
  `pc_sc_id` int NOT NULL COMMENT 'statuts criteres id',
  `pc_chemin` varchar(500) DEFAULT NULL,
  `pc_type` varchar(100) DEFAULT NULL,
  `pc_taille` decimal(20,2) NOT NULL DEFAULT '0.00',
  `pc_date_creation` datetime DEFAULT NULL,
  `pc_commentaire` varchar(500) DEFAULT NULL,
  `pc_est_archive` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`pc_id`),
  KEY `pc_sc_id` (`pc_sc_id`),
  KEY `pc_preins_id` (`pc_preins_id`),
  KEY `pc_chemin` (`pc_chemin`),
  KEY `pc_gcl_id` (`pc_ca_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_preinscription_criteres_hist`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_preinscription_criteres_hist` (
  `pch_id` int NOT NULL AUTO_INCREMENT,
  `pch_pc_id` int DEFAULT NULL,
  `pch_pc_chemin` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pch_pc_date` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`pch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_preinsmail_list`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_preinsmail_list` (
  `prml_id` int unsigned NOT NULL AUTO_INCREMENT,
  `prml_ml_id` int NOT NULL,
  `prml_preins_id` int DEFAULT NULL,
  `prml_ins_id` int DEFAULT NULL,
  `prml_mailto` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `prml_addional_info` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'This is to save the addional info about the student to whom the email not sent, like password when email is for #compte d''access',
  `prml_est_envoye` tinyint(1) DEFAULT '0',
  `prml_date` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`prml_id`),
  KEY `prml_ml_id` (`prml_ml_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_pv_access`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_pv_access` (
  `pva_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pva_diplome_id` int unsigned NOT NULL DEFAULT '0',
  `pva_niveau_filiere` int unsigned NOT NULL DEFAULT '0',
  `pva_mise_a_niveau` tinyint unsigned NOT NULL,
  `pva_type_access` enum('D','P') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Direct, Parallèle',
  `pva_modele_id` int unsigned NOT NULL,
  PRIMARY KEY (`pva_id`),
  KEY `pva_diplome_id` (`pva_diplome_id`),
  KEY `pva_niveau_filiere` (`pva_niveau_filiere`),
  KEY `pva_mise_a_niveau` (`pva_mise_a_niveau`),
  KEY `pva_modele_id` (`pva_modele_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_pv_deliberations`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_pv_deliberations` (
  `pv_id` int NOT NULL AUTO_INCREMENT,
  `pv_del_id` int DEFAULT NULL,
  `pv_jury_id` int DEFAULT NULL,
  `pv_date` datetime DEFAULT NULL,
  PRIMARY KEY (`pv_id`),
  KEY `pv_del_id` (`pv_del_id`),
  KEY `pv_jury_id` (`pv_jury_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_pv_notes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_pv_notes` (
  `pv_id` int unsigned NOT NULL AUTO_INCREMENT,
  `pv_classe_id` int NOT NULL,
  `pv_as_id` int NOT NULL,
  `pv_chemin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pv_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Indicateur d''archivage (0 = non archivé, 1 = archivé)',
  PRIMARY KEY (`pv_id`),
  UNIQUE KEY `pv_classe_id` (`pv_classe_id`,`pv_as_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_recouv_echeances`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_recouv_echeances` (
  `rce_id` int NOT NULL AUTO_INCREMENT,
  `rce_rcv_id` int unsigned NOT NULL,
  `rce_echeance` datetime NOT NULL,
  `rce_montant` decimal(20,2) NOT NULL DEFAULT '0.00',
  `rce_statut` enum('P','N') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Payé, Non payé',
  `rce_methpay_id` int unsigned DEFAULT NULL,
  `rce_rp_id` int unsigned DEFAULT NULL COMMENT 'reçu paiement ID',
  `rce_commentaire` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '',
  PRIMARY KEY (`rce_id`),
  KEY `rce_rcv_id` (`rce_rcv_id`),
  KEY `rce_methpay_id` (`rce_methpay_id`),
  KEY `rce_pp_id` (`rce_rp_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_recouv_periodes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_recouv_periodes` (
  `rcp_id` int NOT NULL AUTO_INCREMENT,
  `rcp_rcv_id` int unsigned NOT NULL COMMENT 'ID du dossier de recouvrement',
  `rcp_pcv_id` int unsigned NOT NULL COMMENT 'ID de la période convenue',
  `rcp_impaye` decimal(20,2) unsigned NOT NULL DEFAULT (0) COMMENT 'Montant impayé de la période',
  `rcp_statut` enum('P','N') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Payé, Non payé',
  PRIMARY KEY (`rcp_id`),
  KEY `rcp_rcv_id` (`rcp_rcv_id`),
  KEY `rcp_pcv_id` (`rcp_pcv_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_recouvrements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_recouvrements` (
  `rcv_id` int NOT NULL AUTO_INCREMENT,
  `rcv_numero` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Numéro du dossier ',
  `rcv_date_ouverture` datetime NOT NULL,
  `rcv_date_modification` datetime DEFAULT NULL,
  `rcv_date_cloture` datetime DEFAULT NULL,
  `rcv_montant` decimal(20,2) NOT NULL DEFAULT (0),
  `rcv_ins_id` int unsigned NOT NULL,
  `rcv_user_id` int unsigned NOT NULL COMMENT 'Responsable du dossier recouvrement',
  `rcv_statut` enum('O','C') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Ouvert, Clos',
  PRIMARY KEY (`rcv_id`),
  KEY `rcv_ins_id` (`rcv_ins_id`),
  KEY `rcv_user_id` (`rcv_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_recu_paiements`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_recu_paiements` (
  `rp_id` int unsigned NOT NULL AUTO_INCREMENT,
  `rp_recu_id` int unsigned NOT NULL,
  `rp_montant` decimal(10,2) NOT NULL,
  `rp_methpay_id` int NOT NULL,
  `rp_piece_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`rp_id`),
  KEY `rp_methpay_id` (`rp_methpay_id`),
  KEY `rp_recu_id` (`rp_recu_id`),
  KEY `rp_piece_id` (`rp_piece_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_recus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_recus` (
  `rec_id` int unsigned NOT NULL AUTO_INCREMENT,
  `rec_numero` varchar(20) DEFAULT NULL,
  `rec_seq` int unsigned DEFAULT NULL,
  `rec_date` date DEFAULT NULL,
  `rec_montant` decimal(10,2) NOT NULL,
  `rec_inscription_id` int unsigned NOT NULL,
  `rec_observation` varchar(300) DEFAULT NULL,
  `rec_user_id` int unsigned NOT NULL,
  `rec_chemin` varchar(255) DEFAULT NULL,
  `rec_est_archive` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`rec_id`),
  KEY `rec_inscription_id` (`rec_inscription_id`),
  KEY `rec_user_id` (`rec_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_reductions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_reductions` (
  `red_id` int unsigned NOT NULL AUTO_INCREMENT,
  `red_typereduction_id` int unsigned NOT NULL,
  `red_fcv_id` int unsigned NOT NULL,
  `red_valeur` decimal(20,2) unsigned NOT NULL,
  `red_base` decimal(20,2) unsigned NOT NULL,
  `red_mode` enum('P','M') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Pourcentage ou Montant',
  `red_commentaire` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`red_id`),
  KEY `red_typereduction_id` (`red_typereduction_id`),
  KEY `red_ins_id` (`red_fcv_id`) USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_releves_notes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_releves_notes` (
  `rlv_id` int unsigned NOT NULL AUTO_INCREMENT,
  `rlv_inscription_id` int NOT NULL,
  `rlv_classe_id` int NOT NULL,
  `rlv_as_id` int NOT NULL,
  `rlv_semestre_id` int DEFAULT NULL COMMENT 'Identifiant du semestre (0 = annuel)',
  `rlv_chemin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Chemin du fichier',
  `rlv_est_archive` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Statut d''archivage (0 = non archivé, 1 = archivé)',
  PRIMARY KEY (`rlv_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `n_utilisateurs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `n_utilisateurs` (
  `user_id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_nom` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_login` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_roles` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'student',
  `user_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_photo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_estActif` tinyint(1) NOT NULL DEFAULT '1',
  `user_role_id` int NOT NULL DEFAULT '2',
  `user_ref_id` int DEFAULT NULL,
  `family_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activation_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_verified` tinyint(1) NOT NULL DEFAULT '0',
  `phone_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `civility` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `formation` int DEFAULT NULL,
  `whatsapp_num` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `centre_id` int DEFAULT NULL,
  `user_dern_conx` timestamp NULL DEFAULT NULL,
  `user_accepter_reglement` tinyint(1) NOT NULL DEFAULT '0',
  `user_bib_status` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `n_utilisateurs_user_nom_unique` (`user_nom`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `nationalite`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `nationalite` (
  `nat_id` int unsigned NOT NULL AUTO_INCREMENT,
  `nat_nom` varchar(40) NOT NULL,
  `nat_arab` tinyint(1) NOT NULL DEFAULT '0',
  `nat_pays_nom` varchar(50) DEFAULT NULL,
  `nat_pays_id` int DEFAULT NULL,
  PRIMARY KEY (`nat_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `niveau`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `niveau` (
  `niv_id` int DEFAULT NULL,
  `niv_nom` varchar(15) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `notde`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `notde` (
  `notde_id` int NOT NULL AUTO_INCREMENT,
  `notde_not_id` int NOT NULL,
  `notde_user_id` int NOT NULL,
  `notde_etat` int NOT NULL,
  PRIMARY KEY (`notde_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `note`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `note` (
  `note_id` int NOT NULL AUTO_INCREMENT,
  `note_note` decimal(10,2) DEFAULT NULL,
  `note_commentaire` mediumtext,
  `note_ctrmm_id` int NOT NULL,
  `note_ins_id` int NOT NULL,
  `note_ratrapage` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`note_id`),
  KEY `note_ctrmm_id` (`note_ctrmm_id`),
  KEY `note_ins_id` (`note_ins_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `notep`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `notep` (
  `note_id` int NOT NULL AUTO_INCREMENT,
  `note_note` decimal(10,2) DEFAULT NULL,
  `note_commentaire` mediumtext,
  `note_ctrmm_id` int NOT NULL,
  `note_ins_id` int NOT NULL,
  `note_ratrapage` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`note_id`),
  KEY `note_ctrmm_id` (`note_ctrmm_id`),
  KEY `note_ins_id` (`note_ins_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `notifications` (
  `not_id` int unsigned NOT NULL AUTO_INCREMENT,
  `not_date_ajout` datetime NOT NULL,
  `not_sdesc` varchar(30) NOT NULL,
  `not_desc` varchar(1000) NOT NULL DEFAULT '',
  `not_vu` int NOT NULL,
  `not_vu_index` int NOT NULL,
  `not_icon` varchar(20) NOT NULL,
  `not_label` varchar(10) NOT NULL,
  `not_user_id` int unsigned DEFAULT NULL,
  `not_role_id` int unsigned DEFAULT NULL COMMENT 'either is being sent to admin or group of users based on value inserted',
  PRIMARY KEY (`not_id`) USING BTREE,
  KEY `not_user_id` (`not_user_id`),
  KEY `not_role_id` (`not_role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `parent_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `parent_messages` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` bigint unsigned NOT NULL,
  `teacher_id` bigint unsigned NOT NULL,
  `student_id` bigint unsigned NOT NULL,
  `subject` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('progress','behavior','meeting','general') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('unread','read','archived') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unread',
  `priority` enum('high','medium','low') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'medium',
  `meeting_requested` tinyint(1) NOT NULL DEFAULT '0',
  `meeting_date` timestamp NULL DEFAULT NULL,
  `meeting_status` enum('pending','accepted','declined','completed') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `parent_student`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `parent_student` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` bigint unsigned NOT NULL,
  `student_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `parent_student_parent_id_student_id_unique` (`parent_id`,`student_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `password_reset_tmp`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_reset_tmp` (
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `TokenKey` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration_date` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `password_reset_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `personal_access_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `personal_access_tokens` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint unsigned NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `abilities` text COLLATE utf8mb4_unicode_ci,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `pinned_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pinned_messages` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `message_id` bigint unsigned NOT NULL,
  `conversation_id` bigint unsigned NOT NULL,
  `pinned_by` bigint unsigned NOT NULL,
  `pin_note` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pinned_messages_message_id_conversation_id_unique` (`message_id`,`conversation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_username_unique` (`username`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `websockets_statistics_entries`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `websockets_statistics_entries` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `app_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `peak_connection_count` int NOT NULL,
  `websocket_message_count` int NOT NULL,
  `api_message_count` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1,'0000_00_00_000000_create_websockets_statistics_entries_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'2014_10_12_100000_create_password_reset_tokens_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'2019_08_19_000000_create_failed_jobs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4,'2019_12_14_000001_create_personal_access_tokens_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (5,'2024_03_19_000001_create_n_utilisateurs_table_temp',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (6,'2024_03_19_000012_create_notifications_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (7,'2024_03_20_000002_create_academic_messages_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (8,'2024_03_20_000003_create_parent_messages_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (9,'2024_03_20_000005_create_message_attachments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (10,'2024_03_21_000002_create_parent_student_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2024_03_22_000002_create_pinned_messages_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (12,'2024_11_19_114039_create_feeds_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13,'2024_11_19_115649_create_likes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14,'2024_11_19_123303_create_comments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15,'2025_01_01_000001_create_conversations_table_mysql',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (16,'2025_01_01_000002_create_messages_table_mysql',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17,'2025_01_01_000003_create_conversation_participants_table_mysql',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18,'2025_01_01_000004_create_announcements_table_mysql',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (19,'2025_01_01_000005_create_courses_table_mysql',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (20,'2025_01_01_000006_create_message_reactions_table_mysql',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (21,'2025_01_01_000007_create_message_statuses_table_mysql',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (22,'2025_01_01_000008_create_course_teacher_pivot_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (23,'2025_01_01_000009_create_course_student_pivot_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (24,'2025_06_13_203914_create_password_reset_tmp_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (25,'2025_08_02_014956_create_jobs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (26,'2014_10_12_000000_create_users_table',2);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (27,'2025_09_03_204507_add_mime_type_to_message_attachments_table',3);
