CREATE TABLE `periode_calendrier` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `id_version_periode_vigueur` bigint(20) DEFAULT NULL, `id_usager_creation` bigint(20) NOT NULL, `date_creation` timestamp NOT NULL DEFAULT current_timestamp(), `id_usager_modification` bigint(20) DEFAULT NULL, `date_modification` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `periode_calendrier_fk_1` (`id_version_periode_vigueur`), CONSTRAINT `periode_calendrier_fk_1` FOREIGN KEY (`id_version_periode_vigueur`) REFERENCES `version_periode_calendrier` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=2124 DEFAULT CHARSET=utf8; CREATE TABLE `version_periode_calendrier` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `nom` varchar(60) DEFAULT NULL, `actif` tinyint(1) NOT NULL, `id_type_periode` bigint(20) NOT NULL, `id_version_calendrier` bigint(20) DEFAULT NULL, `id_version_periode_calendrier_parent` bigint(20) DEFAULT NULL, `id_usager_creation` bigint(20) NOT NULL, `date_creation` timestamp NOT NULL DEFAULT current_timestamp(), `id_usager_modification` bigint(20) DEFAULT NULL, `date_modification` timestamp NULL DEFAULT NULL, `id_periode_calendrier` bigint(20) NOT NULL, `code_administratif` varchar(20) NOT NULL, `code_etudiant` varchar(20) NOT NULL, `date_debut` date DEFAULT NULL, `date_fin` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `periode_calendrier_fk_1` (`id_version_periode_calendrier_parent`), KEY `periode_calendrier_fk_3` (`id_type_periode`), KEY `periode_calendrier_fk_2` (`id_version_calendrier`), KEY `version_periode_calendrier_fk_4` (`id_periode_calendrier`), CONSTRAINT `version_periode_calendrier_fk_1` FOREIGN KEY (`id_version_periode_calendrier_parent`) REFERENCES `version_periode_calendrier` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `version_periode_calendrier_fk_2` FOREIGN KEY (`id_version_calendrier`) REFERENCES `version_calendrier` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `version_periode_calendrier_fk_3` FOREIGN KEY (`id_type_periode`) REFERENCES `type_periode_calendrier` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `version_periode_calendrier_fk_4` FOREIGN KEY (`id_periode_calendrier`) REFERENCES `periode_calendrier` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=2101 DEFAULT CHARSET=utf8;