-- https://www.phpmyadmin.net/
--
-- Client :  localhost
-- Généré le :  Ven 17 Mars 2017 à 20:44
-- Version du serveur :  5.6.35
-- Version de PHP :  7.1.1


--
-- Base de données :  `ecole`
--

-- --------------------------------------------------------

--
-- Structure de la table `application`
--

CREATE TABLE `application` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `course_id` int(11) NOT NULL,
  `status` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `application`
--

INSERT INTO `application` (`id`, `user_id`, `course_id`, `status`) VALUES
(5, 39, 12, NULL),
(6, 14, 12, NULL),
(7, 14, 6, NULL),
(8, 40, 7, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `course`
--

CREATE TABLE `course` (
  `id` int(11) NOT NULL,
  `diploma_id` int(11) NOT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `conditions` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `course`
--

INSERT INTO `course` (`id`, `diploma_id`, `name`, `conditions`) VALUES
(1, 3, 'A1', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(2, 3, 'A2', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(3, 1, 'A11', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(4, 1, 'A1122', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(5, 6, 'A1232', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(6, 6, 'dklfkl fd', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(7, 5, 'A32432', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(8, 5, '1343', 'Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Pellentesque in ipsum id orci porta dapibus. Cras ultricies ligula sed magna dictum porta. Pellentesque in ipsum id orci porta dapibus. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Donec rutrum congue leo eget malesuada. Donec sollicitudin molestie malesuada.'),
(9, 4, 'test test', 'Pellentesque in ipsum id orci porta dapibus. Donec rutrum congue leo eget malesuada. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Vivamus suscipit tortor eget felis porttitor volutpat. Sed porttitor lectus nibh. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Donec rutrum congue leo eget malesuada.'),
(10, 4, 'etst eje', 'Pellentesque in ipsum id orci porta dapibus. Donec rutrum congue leo eget malesuada. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Vivamus suscipit tortor eget felis porttitor volutpat. Sed porttitor lectus nibh. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Donec rutrum congue leo eget malesuada.'),
(11, 8, 'ddfldflk f fdlkdf', 'Pellentesque in ipsum id orci porta dapibus. Donec rutrum congue leo eget malesuada. Nulla porttitor accumsan tincidunt. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Nulla porttitor accumsan tincidunt. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Proin eget tortor risus. Nulla porttitor accumsan tincidunt. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem.'),
(12, 2, 'jkdfjkdf', 'Quisque velit nisi, pretium ut lacinia in, elementum id enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed porttitor lectus nibh. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Quisque velit nisi, pretium ut lacinia in, elementum id enim. Donec sollicitudin molestie malesuada. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Proin eget tortor risus.'),
(13, 7, 'dsdsdsds', 'Quisque velit nisi, pretium ut lacinia in, elementum id enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed porttitor lectus nibh. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Quisque velit nisi, pretium ut lacinia in, elementum id enim. Donec sollicitudin molestie malesuada. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Proin eget tortor risus.');

-- --------------------------------------------------------

--
-- Structure de la table `course_document_type`
--

CREATE TABLE `course_document_type` (
  `course_id` int(11) NOT NULL,
  `document_type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `course_document_type`
--

INSERT INTO `course_document_type` (`course_id`, `document_type_id`) VALUES
(3, 1),
(3, 2),
(7, 5),
(7, 6),
(7, 7),
(11, 1),
(11, 3),
(11, 7),
(12, 1),
(12, 2),
(12, 3),
(12, 4),
(12, 5),
(12, 6),
(12, 7),
(13, 1),
(13, 2),
(13, 3);

-- --------------------------------------------------------

--
-- Structure de la table `diploma`
--

CREATE TABLE `diploma` (
  `id` int(11) NOT NULL,
  `school_id` int(11) NOT NULL,
  `school_field_id` int(11) NOT NULL,
  `diploma_type_id` int(11) NOT NULL,
  `training_type_id` int(11) NOT NULL,
  `school_year` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `diploma`
--

INSERT INTO `diploma` (`id`, `school_id`, `school_field_id`, `diploma_type_id`, `training_type_id`, `school_year`) VALUES
(1, 1, 1, 2, 5, 2010),
(2, 1, 1, 1, 5, 2017),
(3, 1, 1, 1, 6, 2010),
(4, 1, 3, 2, 6, 2017),
(5, 2, 2, 1, 6, 2017),
(6, 2, 2, 2, 5, 2017),
(7, 2, 2, 1, 5, 2017),
(8, 3, 2, 1, 6, 2018);

-- --------------------------------------------------------

--
-- Structure de la table `diploma_type`
--

CREATE TABLE `diploma_type` (
  `id` int(11) NOT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `diploma_type`
--

INSERT INTO `diploma_type` (`id`, `name`, `description`) VALUES
(1, 'Licence', 'lkdfklfd dfklfdk fdklfdkl fdklfdkl lkfdklf fklfdkl fklfdkl fdklfdkl fdkldfkl fdklfdkl fdklfdkl fdklfdkl fdklfdkl'),
(2, 'Master', 'kldfklfd');

-- --------------------------------------------------------

--
-- Structure de la table `document`
--

CREATE TABLE `document` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `document_type_id` int(11) NOT NULL,
  `application_id` int(11) NOT NULL,
  `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `extension` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `document`
--

INSERT INTO `document` (`id`, `user_id`, `document_type_id`, `application_id`, `filename`, `extension`) VALUES
(62, 39, 1, 5, 'avatar_17-03-2017_1489771820_58cc1d2cc3d7c_4831.png', 'png'),
(63, 39, 2, 5, 'cv_17-03-2017_1489771945_58cc1da9631bd_4664.pdf', 'pdf'),
(64, 39, 8, 5, 'payment_receipt_17-03-2017_1489771982_58cc1dce23c46_4118.jpeg', 'jpeg'),
(65, 14, 1, 6, 'avatar_17-03-2017_1489773874_58cc253267ca2_494.pdf', 'pdf'),
(66, 14, 7, 6, 'attestation4_17-03-2017_1489773874_58cc25326d799_4508.png', 'png'),
(67, 14, 8, 6, 'payment_receipt_17-03-2017_1489777006_58cc316ee7ec2_2600.jpeg', 'jpeg'),
(68, 40, 5, 8, 'attestation2_17-03-2017_1489778442_58cc370a93450_9552.png', 'png'),
(69, 40, 6, 8, 'attestation3_17-03-2017_1489778442_58cc370aa3c72_2821.png', 'png'),
(70, 40, 7, 8, 'attestation4_17-03-2017_1489778442_58cc370aa9448_6036.png', 'png'),
(71, 40, 8, 8, 'payment_receipt_17-03-2017_1489778492_58cc373cd6c26_100.png', 'png');

-- --------------------------------------------------------

--
-- Structure de la table `document_type`
--

CREATE TABLE `document_type` (
  `id` int(11) NOT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `code` varchar(100) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `document_type`
--

INSERT INTO `document_type` (`id`, `name`, `code`) VALUES
(1, 'avatar', 'avatar'),
(2, 'cv', 'cv'),
(3, 'lettre_invitation', 'lettre_invitation'),
(4, 'attestation1', 'attestation1'),
(5, 'attestation2', 'attestation2'),
(6, 'attestation3', 'attestation3'),
(7, 'attestation4', 'attestation4'),
(8, 'payment receipt', 'payment_receipt');

-- --------------------------------------------------------

--
-- Structure de la table `nationality`
--

CREATE TABLE `nationality` (
  `id` int(11) NOT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `nationality`
--

INSERT INTO `nationality` (`id`, `name`) VALUES
(2, 'Francais'),
(1, 'Marocain');

-- --------------------------------------------------------

--
-- Structure de la table `school`
--

CREATE TABLE `school` (
  `id` int(11) NOT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `address` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `phoneNumber` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `school`
--

INSERT INTO `school` (`id`, `name`, `address`, `phoneNumber`, `created_at`, `updated_at`) VALUES
(1, 'EST berrechid', 'klfdkldkl', 'klfdlkfdlk', '2017-03-13 11:46:00', NULL),
(2, 'FST settat', 'fkdlfkdl', 'kfllkdf', '2017-03-13 13:57:00', NULL),
(3, 'ENSA MArakehs', 'ddff ppfdpofd fdpofdopfd', '403004', '2017-03-15 13:40:00', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `school_field`
--

CREATE TABLE `school_field` (
  `id` int(11) NOT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `date_accreditation` datetime NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `school_field`
--

INSERT INTO `school_field` (`id`, `name`, `date_accreditation`, `description`) VALUES
(1, 'Management', '2012-01-01 00:00:00', 'dfklfkl fklfdlk fdklfdklf'),
(2, 'Génie logiciel', '2012-01-01 00:00:00', 'kldfklf fdklfdkl'),
(3, 'Mécanique', '2012-01-01 00:00:00', 'fkfkl fklfk fklfdkl fklfd');

-- --------------------------------------------------------

--
-- Structure de la table `training`
--

CREATE TABLE `training` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `year_graduation` int(11) NOT NULL,
  `specialty` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `establishment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `level` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `moyenne` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `training`
--

INSERT INTO `training` (`id`, `user_id`, `year_graduation`, `specialty`, `establishment`, `level`, `moyenne`) VALUES
(12, 14, 2011, 'Génie logiciel', 'EST de berchid', 'Bac+2', '15'),
(13, 39, 2013, 'fvq', 'fbfqv', 'Bac+3', '14'),
(14, 40, 2015, 'systems informatiques', 'fsts', 'Bac+5', '12,23');

-- --------------------------------------------------------

--
-- Structure de la table `training_type`
--

CREATE TABLE `training_type` (
  `id` int(11) NOT NULL,
  `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `training_type`
--

INSERT INTO `training_type` (`id`, `name`) VALUES
(5, 'Formation continue'),
(6, 'Formation initiale');

-- --------------------------------------------------------

--
-- Structure de la table `user_diploma_type`
--

CREATE TABLE `user_diploma_type` (
  `user_id` int(11) NOT NULL,
  `diploma_type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `user_diploma_type`
--

INSERT INTO `user_diploma_type` (`user_id`, `diploma_type_id`) VALUES
(14, 1),
(14, 2),
(37, 1),
(37, 2),
(39, 1),
(39, 2),
(40, 1),
(40, 2);

--
-- Index pour les tables exportées
--

--
-- Index pour la table `application`
--
ALTER TABLE `application`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_A45BDDC1A76ED395` (`user_id`),
  ADD KEY `IDX_A45BDDC1591CC992` (`course_id`);

--
-- Index pour la table `course`
--
ALTER TABLE `course`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_169E6FB95E237E06` (`name`),
  ADD KEY `IDX_169E6FB9A99ACEB5` (`diploma_id`);

--
-- Index pour la table `course_document_type`
--
ALTER TABLE `course_document_type`
  ADD PRIMARY KEY (`course_id`,`document_type_id`),
  ADD KEY `IDX_E8E79F63591CC992` (`course_id`),
  ADD KEY `IDX_E8E79F6361232A4F` (`document_type_id`);

--
-- Index pour la table `diploma`
--
ALTER TABLE `diploma`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_EC218957C32A47EE` (`school_id`),
  ADD KEY `IDX_EC218957BA7133F4` (`school_field_id`),
  ADD KEY `IDX_EC218957D2BDC45D` (`diploma_type_id`),
  ADD KEY `IDX_EC21895718721C9D` (`training_type_id`);

--
-- Index pour la table `diploma_type`
--
ALTER TABLE `diploma_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_DD5D6F5E237E06` (`name`);

--
-- Index pour la table `document`
--
ALTER TABLE `document`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_D8698A76A76ED395` (`user_id`),
  ADD KEY `IDX_D8698A7661232A4F` (`document_type_id`),
  ADD KEY `IDX_D8698A763E030ACD` (`application_id`);

--
-- Index pour la table `document_type`
--
ALTER TABLE `document_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_2B6ADBBA5E237E06` (`name`);

--
-- Index pour la table `nationality`
--
ALTER TABLE `nationality`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_8AC58B705E237E06` (`name`);

--
-- Index pour la table `school`
--
ALTER TABLE `school`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_F99EDABB5E237E06` (`name`);

--
-- Index pour la table `school_field`
--
ALTER TABLE `school_field`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_850FF3425E237E06` (`name`);

--
-- Index pour la table `training`
--
ALTER TABLE `training`
  ADD PRIMARY KEY (`id`),
  ADD KEY `IDX_D5128A8FA76ED395` (`user_id`);

--
-- Index pour la table `training_type`
--
ALTER TABLE `training_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNIQ_8344106A5E237E06` (`name`);

--
-- Index pour la table `user_diploma_type`
--
ALTER TABLE `user_diploma_type`
  ADD PRIMARY KEY (`user_id`,`diploma_type_id`),
  ADD KEY `IDX_8011216DA76ED395` (`user_id`),
  ADD KEY `IDX_8011216DD2BDC45D` (`diploma_type_id`);

--
-- AUTO_INCREMENT pour les tables exportées
--

--
-- AUTO_INCREMENT pour la table `application`
--
ALTER TABLE `application`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT pour la table `course`
--
ALTER TABLE `course`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT pour la table `diploma`
--
ALTER TABLE `diploma`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT pour la table `diploma_type`
--
ALTER TABLE `diploma_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT pour la table `document`
--
ALTER TABLE `document`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=72;
--
-- AUTO_INCREMENT pour la table `document_type`
--
ALTER TABLE `document_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT pour la table `nationality`
--
ALTER TABLE `nationality`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT pour la table `school`
--
ALTER TABLE `school`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pour la table `school_field`
--
ALTER TABLE `school_field`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pour la table `training`
--
ALTER TABLE `training`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT pour la table `training_type`
--
ALTER TABLE `training_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- Contraintes pour les tables exportées
--

--
-- Contraintes pour la table `application`
--
ALTER TABLE `application`
  ADD CONSTRAINT `FK_A45BDDC1591CC992` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`),
  ADD CONSTRAINT `FK_A45BDDC1A76ED395` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Contraintes pour la table `course`
--
ALTER TABLE `course`
  ADD CONSTRAINT `FK_169E6FB9A99ACEB5` FOREIGN KEY (`diploma_id`) REFERENCES `diploma` (`id`);

--
-- Contraintes pour la table `course_document_type`
--
ALTER TABLE `course_document_type`
  ADD CONSTRAINT `FK_E8E79F63591CC992` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`),
  ADD CONSTRAINT `FK_E8E79F6361232A4F` FOREIGN KEY (`document_type_id`) REFERENCES `document_type` (`id`);

--
-- Contraintes pour la table `diploma`
--
ALTER TABLE `diploma`
  ADD CONSTRAINT `FK_EC21895718721C9D` FOREIGN KEY (`training_type_id`) REFERENCES `training_type` (`id`),
  ADD CONSTRAINT `FK_EC218957BA7133F4` FOREIGN KEY (`school_field_id`) REFERENCES `school_field` (`id`),
  ADD CONSTRAINT `FK_EC218957C32A47EE` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`),
  ADD CONSTRAINT `FK_EC218957D2BDC45D` FOREIGN KEY (`diploma_type_id`) REFERENCES `diploma_type` (`id`);

--
-- Contraintes pour la table `document`
--
ALTER TABLE `document`
  ADD CONSTRAINT `FK_D8698A763E030ACD` FOREIGN KEY (`application_id`) REFERENCES `application` (`id`),
  ADD CONSTRAINT `FK_D8698A7661232A4F` FOREIGN KEY (`document_type_id`) REFERENCES `document_type` (`id`),
  ADD CONSTRAINT `FK_D8698A76A76ED395` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Contraintes pour la table `training`
--
ALTER TABLE `training`
  ADD CONSTRAINT `FK_D5128A8FA76ED395` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);

--
-- Contraintes pour la table `user_diploma_type`
--
ALTER TABLE `user_diploma_type`
  ADD CONSTRAINT `FK_8011216DA76ED395` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `FK_8011216DD2BDC45D` FOREIGN KEY (`diploma_type_id`) REFERENCES `diploma_type` (`id`);
