DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
  `PK_news_id` int NOT NULL,
  `libelle_news` varchar(220) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `resume_news` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `contenu_news` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `image_news` varchar(220) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_news` date NOT NULL,
  `actif_news` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `news_traduction`;
CREATE TABLE `news_traduction` (
  `PK_news_traduction_id` int NOT NULL,
  `FK_news_id` int NOT NULL,
  `FK_langues_id` int NOT NULL,
  `libelle_news` varchar(220) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `resume_news` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `contenu_news` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


ALTER TABLE `news`
  ADD PRIMARY KEY (`PK_news_id`),
  ADD KEY `actif_news` (`actif_news`),
  ADD KEY `date_news` (`date_news`);

ALTER TABLE `news_traduction`
  ADD PRIMARY KEY (`PK_news_traduction_id`) USING BTREE,
  ADD KEY `FK_news_id` (`FK_news_id`),
  ADD KEY `FK_langues_id` (`FK_langues_id`);


ALTER TABLE `news`
  MODIFY `PK_news_id` int NOT NULL AUTO_INCREMENT;

ALTER TABLE `news_traduction`
  MODIFY `PK_news_traduction_id` int NOT NULL AUTO_INCREMENT;
COMMIT;
