
DROP TABLE IF EXISTS `interactive_contenus`;
CREATE TABLE `interactive_contenus` (
  `PK_interactive_contenus_id` int NOT NULL,
  `libelle_interactive_contenus` varchar(220) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `file_interactive_contenus` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `is_video_interactive_contenus` int NOT NULL DEFAULT '0',
  `mute_interactive_contenus` int NOT NULL DEFAULT '0',
  `loop_interactive_contenus` int NOT NULL DEFAULT '0',
  `autoplay_interactive_contenus` int NOT NULL DEFAULT '0',
  `is360_interactive_contenus` int NOT NULL DEFAULT '0',
  `actif_interactive_contenus` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `interactive_contenus_spots`;
CREATE TABLE `interactive_contenus_spots` (
  `PK_interactive_contenus_spots_id` int NOT NULL,
  `FK_interactive_contenus_id` int NOT NULL,
  `FK_interactive_contenus_spots_type_id` int NOT NULL,
  `libelle_interactive_contenus_spots` varchar(220) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `x_interactive_contenus_spots` float NOT NULL,
  `y_interactive_contenus_spots` float NOT NULL,
  `scale_interactive_contenus_spots` float NOT NULL,
  `content_interactive_contenus_spots` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `icon_interactive_contenus_spots` varchar(220) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `actif_interactive_contenus_spots` int NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `interactive_contenus_spots_type`;
CREATE TABLE `interactive_contenus_spots_type` (
  `PK_interactive_contenus_spots_type_id` int NOT NULL,
  `libelle_interactive_contenus_spots_type` varchar(220) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `actif_interactive_contenus_spots_type` int NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `interactive_contenus_spots_type` (`PK_interactive_contenus_spots_type_id`, `libelle_interactive_contenus_spots_type`, `actif_interactive_contenus_spots_type`) VALUES
(1, 'wysiwyg', 1),
(2, 'iframe', 1),
(3, 'script', 1),
(4, 'change_view', 1),
(5, 'change_page', 1),
(6, 'open_new_page', 1);

ALTER TABLE `interactive_contenus`
  ADD PRIMARY KEY (`PK_interactive_contenus_id`),
  ADD KEY `actif_interactive_contenus` (`actif_interactive_contenus`),
  ADD KEY `libelle_interactive_contenus` (`libelle_interactive_contenus`);

ALTER TABLE `interactive_contenus_spots`
  ADD PRIMARY KEY (`PK_interactive_contenus_spots_id`) USING BTREE,
  ADD KEY `FK_interactive_contenus_spots_type_id` (`FK_interactive_contenus_spots_type_id`),
  ADD KEY `libelle_interactive_contenus_spots` (`libelle_interactive_contenus_spots`),
  ADD KEY `actif_interactive_contenus_spots` (`actif_interactive_contenus_spots`),
  ADD KEY `FK_interactive_contenus_id` (`FK_interactive_contenus_id`);

ALTER TABLE `interactive_contenus_spots_type`
  ADD PRIMARY KEY (`PK_interactive_contenus_spots_type_id`),
  ADD KEY `libelle_interactive_contenus_spots_type` (`libelle_interactive_contenus_spots_type`),
  ADD KEY `actif_interactive_contenus_spots_type` (`actif_interactive_contenus_spots_type`);

ALTER TABLE `interactive_contenus`
  MODIFY `PK_interactive_contenus_id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `interactive_contenus_spots`
  MODIFY `PK_interactive_contenus_spots_id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `interactive_contenus_spots_type`
  MODIFY `PK_interactive_contenus_spots_type_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;
