DROP TABLE IF EXISTS `scans_config`;
CREATE TABLE `scans_config` (
  `PK_scans_config_id` int(11) NOT NULL,
  `libelle_scans_config` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,
  `url_scans_config` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL,
  `signature_scans_config` int(1) NOT NULL,
  `multiple_scans_config` int(1) NOT NULL,
  `actif_scans_config` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `scans_users`;
CREATE TABLE `scans_users` (
  `PK_scans_users_id` int(11) NOT NULL,
  `FK_scans_config_id` int(11) NOT NULL,
  `FK_users_id` int(11) NOT NULL,
  `date_scans_users` datetime NOT NULL,
  `signature_scans_users` varchar(220) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


ALTER TABLE `scans_config`
  ADD PRIMARY KEY (`PK_scans_config_id`) USING BTREE,
  ADD KEY `actif_scans_config` (`actif_scans_config`) USING BTREE,
  ADD KEY `libelle_scan_config` (`libelle_scans_config`) USING BTREE,
  ADD KEY `url_scans_config` (`url_scans_config`),
  ADD KEY `signature_scans_config` (`signature_scans_config`);

ALTER TABLE `scans_users`
  ADD PRIMARY KEY (`PK_scans_users_id`),
  ADD KEY `FK_scans_config_id` (`FK_scans_config_id`),
  ADD KEY `FK_users_id` (`FK_users_id`),
  ADD KEY `date_scans_users` (`date_scans_users`);


ALTER TABLE `scans_config`
  MODIFY `PK_scans_config_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `scans_users`
  MODIFY `PK_scans_users_id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;