DROP TABLE IF EXISTS `notification`;
CREATE TABLE `notification` (
  `PK_notification_id` int NOT NULL,
  `start_datetime` datetime NOT NULL,
  `duration` int NOT NULL DEFAULT '0' COMMENT 'En minutes,\r\nSi =0 : Dure juqu''a une action de l''utilisateur',
  `libelle_notification` text COLLATE utf8_unicode_ci NOT NULL,
  `content_notification` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Si vide, on prends le libelle à la place',
  `actif_notification` int NOT NULL DEFAULT '1',
  `all_users` int NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `notification_users`;
CREATE TABLE `notification_users` (
  `PK_notification_users_id` int NOT NULL,
  `FK_notification_id` int NOT NULL,
  `FK_users_id` int NOT NULL,
  `closed` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `notification`
  ADD PRIMARY KEY (`PK_notification_id`);
ALTER TABLE `notification_users`
  ADD PRIMARY KEY (`PK_notification_users_id`);
ALTER TABLE `notification`
  MODIFY `PK_notification_id` int NOT NULL AUTO_INCREMENT;
ALTER TABLE `notification_users`
  MODIFY `PK_notification_users_id` int NOT NULL AUTO_INCREMENT;
COMMIT;
