DROP TABLE IF EXISTS `booth`;
CREATE TABLE `booth` (
  `PK_booth_id` int(11) NOT NULL,
  `libelle_booth` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `photo_booth` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `actif_booth` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `booth_spot`;
CREATE TABLE `booth_spot` (
  `PK_booth_spot_id` int(11) NOT NULL,
  `FK_booth_id` int(11) NOT NULL,
  `FK_booth_spot_id` int(11) NOT NULL DEFAULT 0,
  `FK_booth_spot_type_id` int(11) NOT NULL,
  `libelle_booth_spot` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `x_booth_spot` float NOT NULL,
  `y_booth_spot` float NOT NULL,
  `content_booth_spot` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `menu_booth_spot` int(1) NOT NULL DEFAULT 1,
  `icon_booth_spot` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `ordre_booth_spot` int(11) NOT NULL DEFAULT 1,
  `actif_booth_spot` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `booth_spot_type`;
CREATE TABLE `booth_spot_type` (
  `PK_booth_spot_type_id` int(11) NOT NULL,
  `libelle_booth_spot_type` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `pop_booth_spot_type` int(11) NOT NULL DEFAULT 0,
  `frame_booth_spot_type` int(11) NOT NULL DEFAULT 0,
  `html_booth_spot_type` int(11) NOT NULL DEFAULT 0,
  `script_booth_spot_type` int(11) NOT NULL DEFAULT 0,
  `actif_booth_spot_type` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


ALTER TABLE `booth`
  ADD PRIMARY KEY (`PK_booth_id`),
  ADD KEY `libelle_booth` (`libelle_booth`),
  ADD KEY `actif_booth` (`actif_booth`);

ALTER TABLE `booth_spot`
  ADD PRIMARY KEY (`PK_booth_spot_id`),
  ADD KEY `FK_booth_spot_type_id` (`FK_booth_spot_type_id`),
  ADD KEY `libelle_booth_spot` (`libelle_booth_spot`),
  ADD KEY `actif_booth_spot` (`actif_booth_spot`),
  ADD KEY `FK_booth_id` (`FK_booth_id`),
  ADD KEY `order_booth_spot` (`ordre_booth_spot`),
  ADD KEY `FK_booth_spot_id` (`FK_booth_spot_id`),
  ADD KEY `menu_booth_spot` (`menu_booth_spot`);

ALTER TABLE `booth_spot_type`
  ADD PRIMARY KEY (`PK_booth_spot_type_id`),
  ADD KEY `libelle_booth_spot_type` (`libelle_booth_spot_type`),
  ADD KEY `actif_booth_spot_type` (`actif_booth_spot_type`);


ALTER TABLE `booth`
  MODIFY `PK_booth_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `booth_spot`
  MODIFY `PK_booth_spot_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `booth_spot_type`
  MODIFY `PK_booth_spot_type_id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
