DROP TABLE IF EXISTS `exhibition_booths`;

CREATE TABLE `exhibition_booths` (

  `PK_exhibition_booths_id` int(11) NOT NULL,

  `FK_exhibition_booths_id` int(11) NOT NULL DEFAULT 0,

  `libelle_exhibition_booths` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `description_exhibition_booths` text COLLATE utf8mb4_unicode_ci NOT NULL,

  `picture_exhibition_booths` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `ordre_exhibition_booths` int(11) NOT NULL DEFAULT 1,

  `actif_exhibition_booths` int(1) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_contact`;

CREATE TABLE `exhibition_contact` (

  `PK_exhibition_contact_id` int(11) NOT NULL,

  `FK_exhibition_users_id` int(11) NOT NULL DEFAULT 0,

  `last_name_exhibition_contact` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `first_name_exhibition_contact` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `email_exhibition_contact` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `phone_exhibition_contact` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `content_exhibition_contact` text COLLATE utf8mb4_unicode_ci NOT NULL,

  `date_exhibition_contact` datetime NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_events`;

CREATE TABLE `exhibition_events` (

  `PK_exhibition_events_id` int(11) NOT NULL,

  `FK_exhibition_users_id` int(11) NOT NULL,

  `FK_exhibition_packages_id` int(11) NOT NULL,

  `FK_exhibition_thematics_id` int(11) NOT NULL,

  `libelle_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `date_begin_exhibition_events` date NOT NULL DEFAULT '0000-00-00',

  `time_begin_exhibition_events` time NOT NULL DEFAULT '00:00:00',

  `date_end_exhibition_events` date NOT NULL DEFAULT '0000-00-00',

  `time_end_exhibition_events` time NOT NULL DEFAULT '00:00:00',

  `where_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `address_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `who_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `phone_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `booth_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `area_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `note_exhibition_events` int(1) NOT NULL,

  `picture_exhibition_events` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `commentaire_exhibition_events` text COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `number_update_exhibition_events` int(11) NOT NULL DEFAULT 0,

  `date_update_exhibition_events` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

  `date_creation_exhibition_events` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

  `draft_exhibition_events` int(1) NOT NULL DEFAULT 1,

  `actif_exhibition_events` int(1) NOT NULL DEFAULT 1

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_events_files`;

CREATE TABLE `exhibition_events_files` (

  `PK_exhibition_events_files_id` int(11) NOT NULL,

  `FK_exhibition_users_id` int(11) NOT NULL,

  `FK_exhibition_events_id` int(11) NOT NULL,

  `original_name_exhibition_files` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `name_exhibition_files` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `date_upload_exhibition_files` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_events_items`;

CREATE TABLE `exhibition_events_items` (

  `PK_exhibition_events_items_id` int(11) NOT NULL,

  `FK_exhibition_users_id` int(11) NOT NULL,

  `FK_exhibition_events_id` int(11) NOT NULL,

  `FK_exhibition_items_id` int(11) NOT NULL,

  `date_exhibition_events_items` datetime NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_items`;

CREATE TABLE `exhibition_items` (

  `PK_exhibition_items_id` int(11) NOT NULL,

  `FK_exhibition_items_types_id` int(11) NOT NULL,

  `libelle_exhibition_items` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `description_exhibition_items` text COLLATE utf8mb4_unicode_ci NOT NULL,

  `picture_exhibition_items` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `file_exhibition_items` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `catalog_exhibition_items` int(1) NOT NULL DEFAULT 1,

  `actif_exhibition_items` int(1) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_items_types`;

CREATE TABLE `exhibition_items_types` (

  `PK_exhibition_items_types_id` int(1) NOT NULL,

  `FK_exhibition_items_types_id` int(11) NOT NULL,

  `libelle_exhibition_items_types` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `ordre_exhibition_items_types` int(11) NOT NULL DEFAULT 1,

  `mandatory_exhibition_items_types` int(1) NOT NULL DEFAULT 0,

  `title_selector_items_types` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `desc_selector_items_types` text COLLATE utf8mb4_unicode_ci NOT NULL,

  `catalog_exhibition_items_types` int(1) NOT NULL DEFAULT 0,

  `actif_exhibition_items_types` int(1) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_packages`;

CREATE TABLE `exhibition_packages` (

  `PK_exhibition_packages_id` int(11) NOT NULL,

  `FK_exhibition_thematics_id` int(11) NOT NULL,

  `FK_exhibition_booths_id` int(11) NOT NULL,

  `libelle_exhibition_packages` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `description_exhibition_packages` text COLLATE utf8mb4_unicode_ci NOT NULL,

  `picture_exhibition_packages` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `ordre_exhibition_packages` int(11) NOT NULL,

  `actif_exhibition_packages` int(1) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_packages_items`;

CREATE TABLE `exhibition_packages_items` (

  `PK_exhibition_packages_items_id` int(11) NOT NULL,

  `FK_exhibition_packages_id` int(11) NOT NULL,

  `FK_exhibition_items_id` int(11) NOT NULL,

  `default_exhibition_packages_items` int(1) NOT NULL DEFAULT 0

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_packages_items_types`;

CREATE TABLE `exhibition_packages_items_types` (

  `PK_exhibition_packages_items_types_id` int(11) NOT NULL,

  `FK_exhibition_packages_id` int(11) NOT NULL,

  `FK_exhibition_items_types_id` int(11) NOT NULL,

  `multiple_exhibition_packages_items_types` int(1) NOT NULL DEFAULT 0,

  `max_exhibition_packages_items_types` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_thematics`;

CREATE TABLE `exhibition_thematics` (

  `PK_exhibition_thematics_id` int(11) NOT NULL,

  `libelle_exhibition_thematics` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `description_exhibition_thematics` text COLLATE utf8mb4_unicode_ci NOT NULL,

  `picture_exhibition_thematics` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,

  `actif_exhibition_thematics` int(1) NOT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



DROP TABLE IF EXISTS `exhibition_users`;

CREATE TABLE `exhibition_users` (

  `PK_exhibition_users_id` int(11) NOT NULL,

  `FK_users_id` int(11) NOT NULL,

  `exhibition_position` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `exhibition_region` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `exhibition_picture` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',

  `exhibition_valide` int(1) NOT NULL DEFAULT 0,

  `exhibition_date_valide` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

  `exhibition_date_creation` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;





ALTER TABLE `exhibition_booths`

  ADD PRIMARY KEY (`PK_exhibition_booths_id`),

  ADD KEY `libelle_exhibition_items` (`libelle_exhibition_booths`),

  ADD KEY `actif_exhibition_items` (`actif_exhibition_booths`),

  ADD KEY `ordre_exhibition_booths` (`ordre_exhibition_booths`),

  ADD KEY `FK_exhibition_booths_id` (`FK_exhibition_booths_id`);



ALTER TABLE `exhibition_contact`

  ADD PRIMARY KEY (`PK_exhibition_contact_id`),

  ADD KEY `FK_exhibition_users_id` (`FK_exhibition_users_id`),

  ADD KEY `date_exhibition_contact` (`date_exhibition_contact`);



ALTER TABLE `exhibition_events`

  ADD PRIMARY KEY (`PK_exhibition_events_id`),

  ADD KEY `actif_exhibition_events` (`actif_exhibition_events`),

  ADD KEY `libelle_exhibition_events` (`libelle_exhibition_events`),

  ADD KEY `where_exhibition_events` (`where_exhibition_events`),

  ADD KEY `FK_exhibition_users_id` (`FK_exhibition_users_id`),

  ADD KEY `FK_exhibition_packages_id` (`FK_exhibition_packages_id`),

  ADD KEY `FK_exhibition_thematics_id` (`FK_exhibition_thematics_id`),

  ADD KEY `date_update_exhibition_events` (`date_update_exhibition_events`),

  ADD KEY `number_update_exhibition_events` (`number_update_exhibition_events`),

  ADD KEY `note_exhibition_events` (`note_exhibition_events`);



ALTER TABLE `exhibition_events_files`

  ADD PRIMARY KEY (`PK_exhibition_events_files_id`),

  ADD KEY `FK_exhibition_users_id` (`FK_exhibition_users_id`),

  ADD KEY `FK_exhibition_events_id` (`FK_exhibition_events_id`),

  ADD KEY `original_name_exhibition_files` (`original_name_exhibition_files`),

  ADD KEY `date_upload_exhibition_files` (`date_upload_exhibition_files`);



ALTER TABLE `exhibition_events_items`

  ADD PRIMARY KEY (`PK_exhibition_events_items_id`),

  ADD KEY `FK_exhibition_events_id` (`FK_exhibition_events_id`),

  ADD KEY `FK_exhibition_items_id` (`FK_exhibition_items_id`),

  ADD KEY `FK_exhibition_users_id` (`FK_exhibition_users_id`);



ALTER TABLE `exhibition_items`

  ADD PRIMARY KEY (`PK_exhibition_items_id`),

  ADD KEY `libelle_exhibition_items` (`libelle_exhibition_items`),

  ADD KEY `actif_exhibition_items` (`actif_exhibition_items`),

  ADD KEY `FK_exhibitionitems_types_id` (`FK_exhibition_items_types_id`),

  ADD KEY `catalog_exhibition_items` (`catalog_exhibition_items`);



ALTER TABLE `exhibition_items_types`

  ADD PRIMARY KEY (`PK_exhibition_items_types_id`),

  ADD KEY `libelle_exhibition_items_types` (`libelle_exhibition_items_types`),

  ADD KEY `actif_exhibition_items_types` (`actif_exhibition_items_types`),

  ADD KEY `order_exhibition_items_types` (`ordre_exhibition_items_types`),

  ADD KEY `FK_Table: exhibition_items_types_id` (`FK_exhibition_items_types_id`),

  ADD KEY `mandatory_exhibition_items_types` (`mandatory_exhibition_items_types`),

  ADD KEY `catalog_exhibition_items_types` (`catalog_exhibition_items_types`);



ALTER TABLE `exhibition_packages`

  ADD PRIMARY KEY (`PK_exhibition_packages_id`),

  ADD KEY `FK_exhibition_thematics_id` (`FK_exhibition_thematics_id`),

  ADD KEY `FK_exhibition_booths_id` (`FK_exhibition_booths_id`),

  ADD KEY `actif_exhibition_packages` (`actif_exhibition_packages`),

  ADD KEY `ordre_exhibition_packages` (`ordre_exhibition_packages`);



ALTER TABLE `exhibition_packages_items`

  ADD PRIMARY KEY (`PK_exhibition_packages_items_id`),

  ADD KEY `FK_exhibition_packages_id` (`FK_exhibition_packages_id`),

  ADD KEY `FK_exhibition_items_id` (`FK_exhibition_items_id`),

  ADD KEY `default_exhibition_packages_items` (`default_exhibition_packages_items`);



ALTER TABLE `exhibition_packages_items_types`

  ADD PRIMARY KEY (`PK_exhibition_packages_items_types_id`),

  ADD KEY `FK_exhibition_packages_id` (`FK_exhibition_packages_id`),

  ADD KEY `FK_exhibition_items_types_id` (`FK_exhibition_items_types_id`);



ALTER TABLE `exhibition_thematics`

  ADD PRIMARY KEY (`PK_exhibition_thematics_id`),

  ADD KEY `actif_exhibition_booths_thematic` (`actif_exhibition_thematics`),

  ADD KEY `libelle_exhibition_booths_thematic` (`libelle_exhibition_thematics`);



ALTER TABLE `exhibition_users`

  ADD PRIMARY KEY (`PK_exhibition_users_id`),

  ADD KEY `FK_users_id` (`FK_users_id`),

  ADD KEY `exhibition_valide` (`exhibition_valide`);





ALTER TABLE `exhibition_booths`

  MODIFY `PK_exhibition_booths_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_contact`

  MODIFY `PK_exhibition_contact_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_events`

  MODIFY `PK_exhibition_events_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_events_files`

  MODIFY `PK_exhibition_events_files_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_events_items`

  MODIFY `PK_exhibition_events_items_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_items`

  MODIFY `PK_exhibition_items_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_items_types`

  MODIFY `PK_exhibition_items_types_id` int(1) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_packages`

  MODIFY `PK_exhibition_packages_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_packages_items`

  MODIFY `PK_exhibition_packages_items_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_packages_items_types`

  MODIFY `PK_exhibition_packages_items_types_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_thematics`

  MODIFY `PK_exhibition_thematics_id` int(11) NOT NULL AUTO_INCREMENT;



ALTER TABLE `exhibition_users`

  MODIFY `PK_exhibition_users_id` int(11) NOT NULL AUTO_INCREMENT;

COMMIT;

