-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : jeu. 22 jan. 2026 à 23:03
-- Version du serveur : 10.4.32-MariaDB
-- Version de PHP : 8.2.12

START TRANSACTION;



--
-- Base de données : `php_repair`
--

-- --------------------------------------------------------

--
-- Structure de la table `machines`
--

CREATE TABLE `machines` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `machines`
--

INSERT INTO `machines` (`id`, `name`) VALUES
(8, 'B57'),
(17, 'CT41'),
(14, 'D55'),
(15, 'E56'),
(18, 'Emballeuse'),
(11, 'F56'),
(7, 'F73'),
(2, 'M63'),
(19, 'Maintenance'),
(13, 'P56'),
(5, 'POLYSTAR'),
(4, 'R48'),
(16, 'R56'),
(3, 'R69'),
(1, 'R72'),
(6, 'SLITTER'),
(9, 'U65'),
(12, 'W27'),
(10, 'W51');

-- --------------------------------------------------------

--
-- Structure de la table `maintenance_plans`
--

CREATE TABLE `maintenance_plans` (
  `id` int(10) UNSIGNED NOT NULL,
  `title` varchar(150) NOT NULL,
  `task_code` varchar(50) DEFAULT NULL,
  `machine_id` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `estimated_duration_hours` decimal(4,2) DEFAULT NULL,
  `requires_shutdown` tinyint(1) NOT NULL DEFAULT 0,
  `default_assigned_to` int(10) UNSIGNED DEFAULT NULL,
  `recurrence_type` enum('journalier','hebdomadaire','mensuel','annuel') NOT NULL,
  `recurrence_interval` int(10) UNSIGNED NOT NULL DEFAULT 1,
  `day_of_week` tinyint(3) UNSIGNED DEFAULT NULL,
  `day_of_month` tinyint(3) UNSIGNED DEFAULT NULL,
  `month_of_year` tinyint(3) UNSIGNED DEFAULT NULL,
  `start_date` date NOT NULL,
  `next_due_date` date NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `maintenance_plans`
--

INSERT INTO `maintenance_plans` (`id`, `title`, `task_code`, `machine_id`, `description`, `estimated_duration_hours`, `requires_shutdown`, `default_assigned_to`, `recurrence_type`, `recurrence_interval`, `day_of_week`, `day_of_month`, `month_of_year`, `start_date`, `next_due_date`, `is_active`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'CT41_5 - Vérifier la tenison de la chaine du capstan', 'CT41_5', 17, 'Vérifier la tenison de la chaine du capstan', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:48:49', NULL),
(2, 'CT41_6 - Vérifier la tension de la courroie principale', 'CT41_6', 17, 'Vérifier la tension de la courroie principale', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2026-01-23', 1, 4, '2025-12-10 10:48:49', '2026-01-22 10:06:54'),
(3, 'CT41_8 - Vérifier les rouleaux d\'aluminium (tourne facilement)', 'CT41_8', 17, 'Vérifier les rouleaux d\'aluminium (tourne facilement)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:48:49', NULL),
(4, 'CT41_9 - Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 'CT41_9', 17, 'Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:48:49', NULL),
(5, 'M63_3 - Graissage de Nip Roll (En bas)', 'M63_3', 2, 'Graissage de Nip Roll (En bas)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(6, 'M63_4 - Graissage de Nip Roll (En haut)', 'M63_4', 2, 'Graissage de Nip Roll (En haut)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(7, 'M63_6 - Vérification de niveau d\'huile hydraulique', 'M63_6', 2, 'Vérification de niveau d\'huile hydraulique', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(8, 'R69_15 - graissage pompes resines', 'R69_15', 3, 'graissage pompes resines ', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(9, 'R69_16 - Purge avec DYNAPURGE', 'R69_16', 3, 'Purge avec DYNAPURGE ', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(10, 'R69_17 - Verification indicateur lumineux du traiteur', 'R69_17', 3, 'Verification indicateur lumineux du traiteur ', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(11, 'R69_4 - Graissage du Nip Roll (En bas)', 'R69_4', 3, 'Graissage du Nip Roll (En bas)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(12, 'R69_5 - Graissage du Nip Roll (En haut)', 'R69_5', 3, 'Graissage du Nip Roll (En haut)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(13, 'R69_9 - Vérification du niveau d\'huile hydraulique', 'R69_9', 3, 'Vérification du niveau d\'huile hydraulique', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(14, 'R72_11 - Vérification du niveau d\'huile hydraulique', 'R72_11', 1, 'Vérification du niveau d\'huile hydraulique', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(15, 'R72_19 - graissage pompes a resines', 'R72_19', 1, 'graissage pompes a resines', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(16, 'R72_20 - purge avec DYNAPURGE', 'R72_20', 1, 'purge avec DYNAPURGE ', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(17, 'R72_21 - Verification indicateur lumineux du traiteur', 'R72_21', 1, 'Verification indicateur lumineux du traiteur', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(18, 'R72_5 - Graissage du Nip Roll (en bas)', 'R72_5', 1, 'Graissage du Nip Roll (en bas)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(19, 'R72_6 - Graissage du Nip Roll (en haut)', 'R72_6', 1, 'Graissage du Nip Roll (en haut)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(20, 'B57_12 - Graisser cylindre de transport', 'B57_12', 8, 'Graisser cylindre de transport', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-02-12', '2025-03-14', 1, 4, '2025-12-10 10:52:32', NULL),
(21, 'B57_13 - Graisser engrenages', 'B57_13', 8, 'Graisser engrenages', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-02-12', '2025-03-16', 1, 4, '2025-12-10 10:52:32', NULL),
(22, 'B57_14 - Graisser poulie d\'entrainement des chaînes pour faire avancer/reculer cylindres porte plaque', 'B57_14', 8, 'Graisser poulie d\'entrainement des chaînes pour faire avancer/reculer cylindres porte plaque', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-03', '2025-03-16', 1, 4, '2025-12-10 10:52:32', NULL),
(23, 'B57_15 - Graisser poulie d\'entrainement des chaînes pour faire avancer/reculer cylindres porte plaque', 'B57_15', 8, 'Graisser poulie d\'entrainement des chaînes pour faire avancer/reculer cylindres porte plaque', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-02-12', '2025-03-29', 1, 4, '2025-12-10 10:52:32', NULL),
(24, 'B57_16 - Graisser roulement de tambour central', 'B57_16', 8, 'Graisser roulement de tambour central', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-13', '2025-02-12', 1, 4, '2025-12-10 10:52:32', NULL),
(25, 'B57_18 - Nettoyer cylindre de transport', 'B57_18', 8, 'Nettoyer cylindre de transport', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-13', '2025-03-25', 1, 4, '2025-12-10 10:52:32', NULL),
(26, 'B57_25 - Vérifier le niveau d\'huile de l\'unité de guidage (web guide)', 'B57_25', 8, 'Vérifier le niveau d\'huile de l\'unité de guidage (web guide)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-02-14', '2025-03-16', 1, 4, '2025-12-10 10:52:32', NULL),
(27, 'B57_28 - Vérifier l\'état et positionnement des détecteurs des cylindres porte plaque', 'B57_28', 8, 'Vérifier l\'état et positionnement des détecteurs des cylindres porte plaque', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-02-14', '2025-03-16', 1, 4, '2025-12-10 10:52:32', NULL),
(28, 'B57_30 - Vérifier niveau d\'huile', 'B57_30', 8, 'Vérifier niveau d\'huile', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-02-14', '2025-03-16', 1, 4, '2025-12-10 10:52:32', NULL),
(29, 'B57_33 - Vérifier système pneumatique', 'B57_33', 8, 'Vérifier système pneumatique', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2024-11-15', '2025-03-14', 1, 4, '2025-12-10 10:52:32', NULL),
(30, 'U65_10 - Vérification niveau huile réducteurs et motoréducteurs', 'U65_10', 9, 'Vérification niveau huile réducteurs et motoréducteurs', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(31, 'U65_13 - Vérification niveau graisse pompe roulements tambour', 'U65_13', 9, 'Vérification niveau graisse pompe roulements tambour', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(32, 'U65_28 - Vérification niveau huile réducteurs et motoréducteurs', 'U65_28', 9, 'Vérification niveau huile réducteurs et motoréducteurs', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(33, 'U65_30 - Vérification niveau huile unité de levage ( optionnel)', 'U65_30', 9, 'Vérification niveau huile unité de levage ( optionnel)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(34, 'W51_1 - Changer filtre à air', 'W51_1', 10, 'Changer filtre à air', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-06-06', '2025-06-06', 1, 4, '2025-12-10 10:52:32', NULL),
(35, 'W51_10 - Graisser les engrenages', 'W51_10', 10, 'Graisser les engrenages', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-06-06', '2025-06-06', 1, 4, '2025-12-10 10:52:32', NULL),
(36, 'W51_12 - Nettoyer cylindre de transport', 'W51_12', 10, 'Nettoyer cylindre de transport', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(37, 'W51_18 - Vérifier l\'état des paliers lisse', 'W51_18', 10, 'Vérifier l\'état des paliers lisse', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(38, 'W51_19 - Vérifier l\'huile : cabinet hydraulique', 'W51_19', 10, 'Vérifier l\'huile : cabinet hydraulique', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(39, 'W51_20 - Vérifier l\'huile : unité de guidage de bande (web guide)', 'W51_20', 10, 'Vérifier l\'huile : unité de guidage de bande (web guide)', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(40, 'W51_21 - Vérifier l\'huile du gearbox', 'W51_21', 10, 'Vérifier l\'huile du gearbox', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(41, 'W51_22 - Vérifier si il y a une fuite hydraulique', 'W51_22', 10, 'Vérifier si il y a une fuite hydraulique', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(42, 'W51_8 - Graisser cylindre de transport', 'W51_8', 10, 'Graisser cylindre de transport', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(43, 'E56_11 - Vérification de tous les cilindres : en bon etat  et libre en mouvement', 'E56_11', 15, 'Vérification de tous les cilindres : en bon etat  et libre en mouvement', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(44, 'E56_12 - Vérification  de la tension de la courroie du moteur principal', 'E56_12', 15, 'Vérification  de la tension de la courroie du moteur principal ', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(45, 'E56_3 - Vérification de l\'alignement du couteau avec le rouleau de scellage', 'E56_3', 15, 'Vérification de l\'alignement du couteau avec le rouleau de scellage', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(46, 'E56_4 - Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 'E56_4', 15, 'Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(47, 'F56_11 - Vérification de tous les cilindres : en bon etat  et libre en mouvement', 'F56_11', 11, 'Vérification de tous les cilindres : en bon etat  et libre en mouvement', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(48, 'F56_12 - Vérification  de la tension de la courroie du moteur principal', 'F56_12', 11, 'Vérification  de la tension de la courroie du moteur principal ', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(49, 'F56_3 - Vérification de l\'alignement du couteau avec le rouleau de scellage', 'F56_3', 11, 'Vérification de l\'alignement du couteau avec le rouleau de scellage', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(50, 'F56_4 - Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 'F56_4', 11, 'Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(51, 'P56_3 - Vérification de l\'alignement du couteau avec le rouleau de scellage', 'P56_3', 13, 'Vérification de l\'alignement du couteau avec le rouleau de scellage', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(52, 'P56_4 - Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 'P56_4', 13, 'Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(53, 'R56 _11 - Vérification de tous les cilindres : en bon etat  et libre en mouvement', 'R56 _11', 16, 'Vérification de tous les cilindres : en bon etat  et libre en mouvement', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(54, 'R56 _12 - Vérification  de la tension de la courroie du moteur principal', 'R56 _12', 16, 'Vérification  de la tension de la courroie du moteur principal ', 0.25, 0, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-07', '2025-02-06', 1, 4, '2025-12-10 10:52:32', NULL),
(55, 'R56 _3 - Vérification de l\'alignement du couteau avec le rouleau de scellage', 'R56 _3', 16, 'Vérification de l\'alignement du couteau avec le rouleau de scellage', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(56, 'R56 _4 - Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 'R56 _4', 16, 'Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(57, 'W27_3 - Vérification de l\'alignement du couteau avec le rouleau de scellage', 'W27_3', 12, 'Vérification de l\'alignement du couteau avec le rouleau de scellage', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(58, 'W27_4 - Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 'W27_4', 12, 'Vérifier l\'état des fingers (alignement, finger manquant, bonne condition)', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-01-31', 1, 4, '2025-12-10 10:52:32', NULL),
(59, 'FS7300_1 - Lubrification de l\'arbre de rembobinage \"rewind shaft\"', 'FS7300_1', 7, 'Lubrification de l\'arbre de rembobinage \"rewind shaft\"', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:59:08', NULL),
(60, 'FS7300_2 - Lubrification des deux extrémités des roulements à billes', 'FS7300_2', 7, 'Lubrification des deux extrémités des roulements à billes', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:59:08', NULL),
(61, 'FS7300_3 - Lubrification des parties mobiles \"gear\"', 'FS7300_3', 7, 'Lubrification des parties mobiles \"gear\"', 0.25, 1, NULL, 'journalier', 30, NULL, NULL, NULL, '2025-01-01', '2025-02-06', 1, 4, '2025-12-10 10:59:08', NULL),
(66, 'test', 'test', 5, 'ici des infos', 0.25, 0, 7, 'journalier', 3, NULL, NULL, NULL, '2026-01-22', '2026-01-22', 1, 4, '2026-01-22 14:19:02', NULL);

-- --------------------------------------------------------

--
-- Structure de la table `maintenance_tasks`
--

CREATE TABLE `maintenance_tasks` (
  `id` int(10) UNSIGNED NOT NULL,
  `plan_id` int(10) UNSIGNED NOT NULL,
  `required_date` date NOT NULL,
  `required_week` varchar(20) DEFAULT NULL,
  `completed_date` date DEFAULT NULL,
  `completed_valid` tinyint(1) DEFAULT 0,
  `is_machine_stop` tinyint(1) DEFAULT 0,
  `assigned_to` int(10) UNSIGNED DEFAULT NULL,
  `last_execution` date DEFAULT NULL,
  `next_required` date DEFAULT NULL,
  `need_reassign` tinyint(1) DEFAULT 0,
  `is_late` tinyint(1) DEFAULT 0,
  `action_required` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `log_timestamp` datetime DEFAULT NULL,
  `responsible` varchar(100) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL,
  `mtd_is_completed` tinyint(1) NOT NULL DEFAULT 0,
  `mtd_completed_by` varchar(100) DEFAULT NULL,
  `mtd_maintenance_start` datetime DEFAULT NULL,
  `mtd_maintenance_end` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Déchargement des données de la table `maintenance_tasks`
--

INSERT INTO `maintenance_tasks` (`id`, `plan_id`, `required_date`, `required_week`, `completed_date`, `completed_valid`, `is_machine_stop`, `assigned_to`, `last_execution`, `next_required`, `need_reassign`, `is_late`, `action_required`, `notes`, `log_timestamp`, `responsible`, `created_at`, `updated_at`, `mtd_is_completed`, `mtd_completed_by`, `mtd_maintenance_start`, `mtd_maintenance_end`) VALUES
(1, 1, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(2, 1, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(3, 2, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(4, 2, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(5, 3, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(6, 3, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(7, 4, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(8, 4, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:48:49', NULL, 0, NULL, NULL, NULL),
(9, 5, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(10, 5, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(11, 6, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(12, 6, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(13, 7, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(14, 7, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(15, 8, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(16, 8, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(17, 9, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(18, 9, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(19, 10, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(20, 10, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(21, 11, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(22, 11, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(23, 12, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(24, 12, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(25, 13, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(26, 13, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(27, 14, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(28, 14, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(29, 15, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(30, 15, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(31, 16, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(32, 16, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(33, 17, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(34, 17, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(35, 18, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(36, 18, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(37, 19, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(38, 19, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(39, 20, '2025-02-12', NULL, '2025-02-12', 0, 1, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(40, 20, '2025-01-13', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(41, 21, '2025-02-12', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(42, 21, '2025-01-13', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(43, 22, '2025-01-03', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(44, 22, '2024-12-04', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(45, 23, '2025-02-12', NULL, '2025-02-27', 0, 1, NULL, '2025-02-27', '2025-03-29', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(46, 23, '2025-01-13', NULL, '2025-02-12', 0, 1, NULL, '2025-02-27', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(47, 24, '2025-01-13', NULL, '2025-01-13', 0, 1, NULL, '2025-01-13', '2025-02-12', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(48, 24, '2025-01-13', NULL, '2025-01-13', 0, 1, NULL, '2025-01-13', '2025-02-12', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(49, 25, '2025-01-13', NULL, '2025-02-23', 0, 1, NULL, '2025-02-23', '2025-03-25', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(50, 25, '2025-01-13', NULL, '2025-01-24', 0, 1, NULL, '2025-02-23', '2025-02-23', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(51, 26, '2025-02-14', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(52, 26, '2024-11-15', NULL, '2025-02-12', 0, 1, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(53, 27, '2025-02-14', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(54, 27, '2024-11-15', NULL, '2025-01-31', 0, 1, NULL, '2025-02-14', '2025-03-02', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(55, 28, '2025-02-14', NULL, '2025-02-14', 0, 0, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(56, 28, '2024-11-15', NULL, '2025-02-12', 0, 0, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(57, 29, '2024-11-15', NULL, '2025-02-12', 0, 0, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(58, 29, '2025-02-14', NULL, '2025-02-14', 0, 0, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(59, 30, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(60, 30, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(61, 31, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(62, 31, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(63, 32, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(64, 32, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(65, 33, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(66, 33, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(67, 34, '2025-06-06', '23', NULL, 0, 1, NULL, '2025-01-07', NULL, 0, 1, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(68, 34, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(69, 35, '2025-06-06', '23', NULL, 0, 1, NULL, '2025-01-07', NULL, 0, 1, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(70, 35, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(71, 36, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(72, 36, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(73, 37, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(74, 37, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(75, 38, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(76, 38, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(77, 39, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(78, 39, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(79, 40, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(80, 40, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(81, 41, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(82, 41, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(83, 42, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(84, 42, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(85, 1, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(86, 1, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(87, 2, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(88, 2, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(89, 3, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(90, 3, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(91, 4, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(92, 4, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(93, 43, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(94, 43, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(95, 44, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(96, 44, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(97, 45, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(98, 45, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(99, 46, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(100, 46, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(101, 47, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(102, 47, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(103, 48, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(104, 48, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(105, 49, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(106, 49, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(107, 50, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(108, 50, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(109, 51, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(110, 51, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(111, 52, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(112, 52, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(113, 53, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(114, 53, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(115, 54, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(116, 54, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(117, 55, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(118, 55, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(119, 56, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(120, 56, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(121, 57, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(122, 57, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(123, 58, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(124, 58, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:52:32', NULL, 0, NULL, NULL, NULL),
(125, 5, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(126, 5, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(127, 6, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(128, 6, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(129, 7, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(130, 7, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(131, 8, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(132, 8, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(133, 9, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(134, 9, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(135, 10, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(136, 10, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(137, 11, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(138, 11, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(139, 12, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(140, 12, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(141, 13, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(142, 13, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(143, 14, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(144, 14, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(145, 15, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(146, 15, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(147, 16, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(148, 16, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'O', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(149, 17, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(150, 17, '2025-01-15', NULL, '2025-01-07', 1, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(151, 18, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(152, 18, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(153, 19, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(154, 19, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(155, 20, '2025-02-12', NULL, '2025-02-12', 0, 1, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(156, 20, '2025-01-13', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(157, 21, '2025-02-12', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(158, 21, '2025-01-13', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(159, 22, '2025-01-03', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(160, 22, '2024-12-04', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(161, 23, '2025-02-12', NULL, '2025-02-27', 0, 1, NULL, '2025-02-27', '2025-03-29', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(162, 23, '2025-01-13', NULL, '2025-02-12', 0, 1, NULL, '2025-02-27', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(163, 24, '2025-01-13', NULL, '2025-01-13', 0, 1, NULL, '2025-01-13', '2025-02-12', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(164, 24, '2025-01-13', NULL, '2025-01-13', 0, 1, NULL, '2025-01-13', '2025-02-12', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(165, 25, '2025-01-13', NULL, '2025-02-23', 0, 1, NULL, '2025-02-23', '2025-03-25', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(166, 25, '2025-01-13', NULL, '2025-01-24', 0, 1, NULL, '2025-02-23', '2025-02-23', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(167, 26, '2025-02-14', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(168, 26, '2024-11-15', NULL, '2025-02-12', 0, 1, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(169, 27, '2025-02-14', NULL, '2025-02-14', 0, 1, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(170, 27, '2024-11-15', NULL, '2025-01-31', 0, 1, NULL, '2025-02-14', '2025-03-02', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(171, 28, '2025-02-14', NULL, '2025-02-14', 0, 0, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(172, 28, '2024-11-15', NULL, '2025-02-12', 0, 0, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(173, 29, '2024-11-15', NULL, '2025-02-12', 0, 0, NULL, '2025-02-14', '2025-03-14', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(174, 29, '2025-02-14', NULL, '2025-02-14', 0, 0, NULL, '2025-02-14', '2025-03-16', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(175, 30, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(176, 30, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(177, 31, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(178, 31, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(179, 32, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(180, 32, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(181, 33, '2025-01-01', NULL, '2025-01-01', 0, 0, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(182, 33, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(183, 34, '2025-06-06', '23', NULL, 0, 1, NULL, '2025-01-07', NULL, 0, 1, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(184, 34, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(185, 35, '2025-06-06', '23', NULL, 0, 1, NULL, '2025-01-07', NULL, 0, 1, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(186, 35, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(187, 36, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(188, 36, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(189, 37, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(190, 37, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(191, 38, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(192, 38, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(193, 39, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(194, 39, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(195, 40, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(196, 40, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(197, 41, '2025-01-01', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(198, 41, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(199, 42, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(200, 42, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(201, 59, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(202, 59, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(203, 60, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(204, 60, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(205, 61, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(206, 61, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(207, 1, '2025-01-01', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(208, 1, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(209, 2, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(210, 2, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(211, 3, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(212, 3, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(213, 4, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(214, 4, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(215, 43, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(216, 43, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(217, 44, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(218, 44, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(219, 45, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(220, 45, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(221, 46, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(222, 46, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(223, 47, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(224, 47, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(225, 48, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(226, 48, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(227, 49, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(228, 49, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(229, 50, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(230, 50, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(231, 51, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(232, 51, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(233, 52, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(234, 52, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(235, 53, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(236, 53, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(237, 54, '2025-01-07', NULL, '2025-01-07', 0, 0, NULL, '2025-01-15', '2025-02-06', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(238, 54, '2025-01-15', NULL, '2025-01-15', 0, 0, NULL, '2025-01-15', '2025-02-14', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(239, 55, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(240, 55, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(241, 56, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(242, 56, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(243, 57, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(244, 57, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'm', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(245, 58, '2025-01-01', NULL, '2025-01-01', 0, 1, NULL, '2025-01-07', '2025-01-31', 1, 0, 'Oui', NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(246, 58, '2025-01-07', NULL, '2025-01-07', 0, 1, NULL, '2025-01-07', '2025-02-06', 0, 0, NULL, NULL, NULL, 'o', '2025-12-10 10:59:08', NULL, 0, NULL, NULL, NULL),
(248, 3, '2026-01-31', NULL, NULL, 0, 1, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, '2026-01-22 10:52:07', '2026-01-22 10:55:25', 0, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Structure de la table `maintenance_tasks_extra`
--

CREATE TABLE `maintenance_tasks_extra` (
  `id` int(11) NOT NULL,
  `plan_id` int(11) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `section` varchar(120) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `comment` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `maintenance_tasks_extra`
--

INSERT INTO `maintenance_tasks_extra` (`id`, `plan_id`, `title`, `description`, `section`, `created_at`, `comment`) VALUES
(1, 66, 'rouleau1', 'principal', 'central', '2026-01-22 14:19:02', 'commentaire');

-- --------------------------------------------------------

--
-- Structure de la table `maintenance_task_time`
--

CREATE TABLE `maintenance_task_time` (
  `id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `started_at` datetime NOT NULL,
  `ended_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `maintenance_task_time`
--

INSERT INTO `maintenance_task_time` (`id`, `task_id`, `started_at`, `ended_at`, `created_at`) VALUES
(1, 248, '2026-01-22 10:52:07', '2026-01-22 10:53:23', '2026-01-22 10:52:07'),
(2, 248, '2026-01-22 10:55:39', '2026-01-22 10:55:45', '2026-01-22 10:55:39'),
(3, 249, '2026-01-22 10:58:47', '2026-01-22 10:58:58', '2026-01-22 10:58:47'),
(4, 250, '2026-01-22 12:26:03', '2026-01-22 12:26:14', '2026-01-22 12:26:03');

-- --------------------------------------------------------

--
-- Structure de la table `operator_types`
--

CREATE TABLE `operator_types` (
  `id` int(11) UNSIGNED NOT NULL,
  `name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `operator_types`
--

INSERT INTO `operator_types` (`id`, `name`) VALUES
(7, 'EXTRUSION'),
(2, 'IMPRIMERIE'),
(10, 'PLIAGE-DÉCOUPE'),
(14, 'RECYCLEUR');

-- --------------------------------------------------------

--
-- Structure de la table `tickets`
--

CREATE TABLE `tickets` (
  `id` int(10) UNSIGNED NOT NULL,
  `title` varchar(150) NOT NULL,
  `machine_name` varchar(100) NOT NULL,
  `employee_number` varchar(30) NOT NULL,
  `description` text NOT NULL,
  `status` enum('ouvert','en_cours','fermé') NOT NULL DEFAULT 'ouvert',
  `priority` enum('basse','normale','haute') NOT NULL DEFAULT 'normale',
  `is_emergency` tinyint(1) NOT NULL DEFAULT 0,
  `is_machine_stop` tinyint(1) NOT NULL DEFAULT 0,
  `downtime_start` datetime DEFAULT NULL,
  `downtime_end` datetime DEFAULT NULL,
  `downtime_minutes` int(11) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `assigned_to` int(10) UNSIGNED DEFAULT NULL,
  `attachments` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `tickets`
--

INSERT INTO `tickets` (`id`, `title`, `machine_name`, `employee_number`, `description`, `status`, `priority`, `is_emergency`, `is_machine_stop`, `downtime_start`, `downtime_end`, `downtime_minutes`, `created_by`, `assigned_to`, `attachments`, `created_at`, `updated_at`) VALUES
(1, 'Le shaft de tirage a cassé', 'Polystar', '1382', 'Le shaft a casser et ne peut plus tirer de poly', 'ouvert', 'haute', 1, 1, NULL, NULL, NULL, 1, NULL, '[\"uploads/1764425334_a64f0170_1000006629.jpg\",\"uploads/1764425334_e75792a1_1000006628.jpg\"]', '2025-11-29 09:08:54', '2025-12-02 08:46:48'),
(2, 'Nip du haut ne ferme plus', 'R-72', '1382', 'La valve a cassee', 'ouvert', 'haute', 1, 1, NULL, NULL, NULL, 1, 6, '[\"uploads/1764504139_fa3e1897_1000006633.jpg\",\"uploads/1764504139_1ead6915_1000006632.jpg\"]', '2025-11-30 07:02:19', '2025-12-02 08:46:46'),
(3, 'Temperatures de la vice r69', 'R-69', '1382', 'Les temperatures ne redesendent plus', 'fermé', 'haute', 1, 1, '2025-12-04 15:55:21', '2025-12-04 15:55:24', 2, 1, 5, '[\"uploads/1764591526_78fbd69c_1000006642.jpg\"]', '2025-12-01 07:18:46', '2025-12-04 10:26:54'),
(5, 'Cycle winder sauter', 'M-63', '1382', 'Le cycle ne veux plus functionner', 'ouvert', 'haute', 1, 0, '2025-12-04 15:24:59', '2025-12-04 15:25:04', 0, 4, NULL, '[\"uploads/1764681071_246819a2_1000006647.jpg\",\"uploads/1764681071_3d16c996_1000006646.jpg\"]', '2025-12-02 08:11:11', '2025-12-04 09:25:04'),
(6, 'Traiteur m63 le cable est bruler', 'M-63', '1382', 'Le cable est briser et le courant saute', 'ouvert', 'haute', 1, 1, NULL, NULL, NULL, 4, 6, '[\"uploads/1764684356_b90ee47c_1000006648.jpg\"]', '2025-12-02 09:05:56', '2025-12-02 09:06:16'),
(7, 'Balon croche', 'R-72', '1382', 'Le balon est croche a cause que le die doit etre trop sale', 'ouvert', 'normale', 1, 0, NULL, NULL, 19071, 4, NULL, '[\"uploads/1764697752_bbce03d1_1000006649.jpg\"]', '2025-12-02 12:49:12', '2026-01-20 18:29:00'),
(9, 'Screenchanger ne tourne plys', 'R-69', '1382', 'La vise de serrage est pas bonne', 'fermé', '', 1, 1, NULL, NULL, NULL, 4, 6, '[\"uploads/1764782204_8701436a_1000006655.jpg\"]', '2025-12-03 12:16:44', '2025-12-03 16:24:30');

-- --------------------------------------------------------

--
-- Structure de la table `ticket_comments`
--

CREATE TABLE `ticket_comments` (
  `id` int(10) UNSIGNED NOT NULL,
  `ticket_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `comment_text` text NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `ticket_comments`
--

INSERT INTO `ticket_comments` (`id`, `ticket_id`, `user_id`, `comment_text`, `created_at`) VALUES
(1, 2, 4, 'réparation faite de soir', '2025-11-30 18:10:07'),
(4, 7, 4, 'test', '2025-12-04 14:17:36');

-- --------------------------------------------------------

--
-- Structure de la table `ticket_downtimes`
--

CREATE TABLE `ticket_downtimes` (
  `id` int(11) NOT NULL,
  `ticket_id` int(11) NOT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime DEFAULT NULL,
  `minutes` int(11) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `ticket_downtimes`
--

INSERT INTO `ticket_downtimes` (`id`, `ticket_id`, `start_time`, `end_time`, `minutes`, `created_by`, `created_at`) VALUES
(1, 3, '2025-12-04 16:24:15', '2025-12-04 16:26:44', 2, 4, '2025-12-04 16:24:15'),
(2, 3, '2025-12-04 16:26:54', NULL, NULL, 4, '2025-12-04 16:26:54'),
(3, 7, '2025-12-04 16:28:27', '2025-12-04 16:30:15', 1, 4, '2025-12-04 16:28:27'),
(4, 7, '2025-12-04 16:32:50', '2025-12-04 16:32:57', 0, 4, '2025-12-04 16:32:50'),
(5, 7, '2025-12-04 16:33:02', '2025-12-04 16:33:08', 0, 4, '2025-12-04 16:33:02'),
(6, 7, '2025-12-04 16:38:28', '2025-12-04 16:38:32', 0, 4, '2025-12-04 16:38:28'),
(7, 7, '2025-12-04 16:39:23', '2025-12-04 16:40:06', 0, 4, '2025-12-04 16:39:23'),
(8, 7, '2025-12-04 16:40:18', '2025-12-04 16:51:02', 10, 4, '2025-12-04 16:40:18'),
(9, 7, '2025-12-04 20:31:29', '2025-12-08 17:20:18', 5568, 4, '2025-12-04 20:31:29'),
(10, 15, '2025-12-08 12:53:32', '2025-12-08 12:53:35', 0, 4, '2025-12-08 12:53:32'),
(11, 7, '2025-12-09 15:40:23', '2025-12-19 00:33:07', 13492, 4, '2025-12-09 15:40:23'),
(12, 7, '2025-12-19 00:33:38', '2025-12-19 00:33:40', 0, 4, '2025-12-19 00:33:38'),
(13, 7, '2026-01-21 00:28:41', '2026-01-21 00:28:52', 0, 4, '2026-01-21 00:28:41'),
(14, 7, '2026-01-21 00:28:56', '2026-01-21 00:29:00', 0, 4, '2026-01-21 00:28:56');

-- --------------------------------------------------------

--
-- Structure de la table `ticket_history`
--

CREATE TABLE `ticket_history` (
  `id` int(10) UNSIGNED NOT NULL,
  `ticket_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `change_type` varchar(50) NOT NULL,
  `old_status` varchar(20) DEFAULT NULL,
  `new_status` varchar(20) DEFAULT NULL,
  `old_assigned_to` int(10) UNSIGNED DEFAULT NULL,
  `new_assigned_to` int(10) UNSIGNED DEFAULT NULL,
  `old_downtime_start` datetime DEFAULT NULL,
  `new_downtime_start` datetime DEFAULT NULL,
  `old_downtime_end` datetime DEFAULT NULL,
  `new_downtime_end` datetime DEFAULT NULL,
  `old_downtime_minutes` int(11) DEFAULT NULL,
  `new_downtime_minutes` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `ticket_history`
--

INSERT INTO `ticket_history` (`id`, `ticket_id`, `user_id`, `change_type`, `old_status`, `new_status`, `old_assigned_to`, `new_assigned_to`, `old_downtime_start`, `new_downtime_start`, `old_downtime_end`, `new_downtime_end`, `old_downtime_minutes`, `new_downtime_minutes`, `created_at`) VALUES
(1, 1, 1, 'update_ticket', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-29 12:52:35'),
(2, 1, 4, 'assign_list', 'ouvert', 'ouvert', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-29 14:08:49'),
(3, 1, 4, 'update_ticket', '', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-29 14:13:01'),
(4, 1, 4, 'update_ticket', '', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 07:03:10'),
(5, 1, 4, 'update_ticket', '', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 07:04:46'),
(6, 2, 4, 'assign_list', 'ouvert', 'ouvert', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 07:59:03'),
(7, 2, 4, 'assign_list', 'ouvert', 'ouvert', 5, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 08:03:27'),
(8, 1, 4, 'update_ticket', '', 'in_progress', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 12:27:56'),
(9, 1, 4, 'status_list', '', 'en_cours', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 18:07:08'),
(10, 1, 4, 'status_list', 'en_cours', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 18:07:16'),
(11, 2, 4, 'update_ticket', 'ouvert', 'resolved', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 18:09:42'),
(12, 2, 4, 'update_ticket', '', 'open', 5, 5, NULL, NULL, NULL, NULL, NULL, NULL, '2025-11-30 18:09:48'),
(13, 2, 1, 'status_list', '', 'ouvert', 5, 5, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 06:35:21'),
(14, 3, 1, 'update_ticket', 'ouvert', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 07:35:07'),
(15, 3, 4, 'update_ticket', '', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 08:08:56'),
(16, 3, 4, 'status_list', '', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 08:09:08'),
(17, 2, 4, 'assign_list', 'ouvert', 'ouvert', 5, 7, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 08:09:15'),
(18, 3, 4, 'assign_list', 'ouvert', 'ouvert', NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 08:42:54'),
(19, 3, 4, 'update_ticket', 'ouvert', 'resolved', 5, 5, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 10:43:54'),
(20, 3, 4, 'status_list', '', 'fermé', 5, 5, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 10:44:06'),
(21, 2, 4, 'assign_list', 'ouvert', 'ouvert', 7, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-01 13:36:33'),
(22, 2, 4, 'update_ticket', 'ouvert', 'open', 6, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-02 07:02:52'),
(23, 1, 4, 'update_ticket', 'ouvert', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-02 07:03:04'),
(24, 1, 4, 'update_ticket', '', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-02 07:05:42'),
(25, 2, 4, 'status_list', '', 'ouvert', 6, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-02 08:46:46'),
(26, 1, 4, 'status_list', '', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-02 08:46:48'),
(27, 6, 4, 'assign_list', 'ouvert', 'ouvert', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-02 09:06:16'),
(28, 8, 4, 'update_ticket', 'ouvert', 'open', NULL, NULL, NULL, '2025-12-01 17:51:00', NULL, NULL, NULL, NULL, '2025-12-02 14:51:48'),
(29, 8, 4, 'update_ticket', '', 'open', NULL, NULL, '2025-12-01 17:51:00', '2025-12-01 17:51:00', NULL, '2025-12-18 17:54:00', NULL, 24483, '2025-12-02 14:51:56'),
(30, 9, 4, 'update_ticket', 'ouvert', 'open', NULL, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-03 12:35:02'),
(31, 9, 4, 'update_ticket', '', 'resolved', 6, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-03 13:00:51'),
(32, 9, 4, 'status_list', '', 'ouvert', 6, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-03 16:23:35'),
(33, 8, 4, 'status_list', '', 'ouvert', NULL, NULL, '2025-12-01 17:51:00', '2025-12-01 17:51:00', '2025-12-18 17:54:00', '2025-12-18 17:54:00', 24483, 24483, '2025-12-03 16:23:39'),
(34, 9, 4, 'status_list', 'ouvert', 'fermé', 6, 6, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-03 16:24:30'),
(35, 8, 4, 'Mise à jour du ticket', '', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 07:46:17'),
(36, 8, 4, 'Mise à jour du ticket', '', 'open', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 08:08:06'),
(37, 5, 4, 'Début arrêt machine', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 09:24:59'),
(38, 5, 4, 'Fin arrêt machine', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 09:25:04'),
(39, 3, 4, 'Début arrêt machine', 'fermé', 'fermé', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 09:55:21'),
(40, 3, 4, 'Fin arrêt machine', 'fermé', 'fermé', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 09:55:24'),
(41, 3, 4, 'Début temps d’arrêt', 'fermé', 'fermé', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:24:15'),
(42, 3, 4, 'Fin temps d’arrêt', 'fermé', 'fermé', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:26:44'),
(43, 3, 4, 'Début temps d’arrêt', 'fermé', 'fermé', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:26:54'),
(44, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:28:27'),
(45, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:30:15'),
(46, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:32:50'),
(47, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:32:57'),
(48, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:33:02'),
(49, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:33:08'),
(50, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:38:28'),
(51, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:38:32'),
(52, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:39:23'),
(53, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:40:06'),
(54, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:40:18'),
(55, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 10:51:02'),
(56, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-04 14:31:29'),
(57, 15, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-08 06:53:32'),
(58, 15, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-08 06:53:35'),
(59, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-08 11:20:18'),
(60, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-09 09:40:23'),
(61, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-18 18:33:07'),
(62, 7, 4, 'Début temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-18 18:33:38'),
(63, 7, 4, 'Fin temps d’arrêt', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-18 18:33:40'),
(64, 7, 4, 'Début arrêt machine', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, 19071, 19071, '2026-01-20 18:28:41'),
(65, 7, 4, 'Fin arrêt machine', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, 19071, 19071, '2026-01-20 18:28:52'),
(66, 7, 4, 'Début arrêt machine', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, 19071, 19071, '2026-01-20 18:28:56'),
(67, 7, 4, 'Fin arrêt machine', 'ouvert', 'ouvert', NULL, NULL, NULL, NULL, NULL, NULL, 19071, 19071, '2026-01-20 18:29:00');

-- --------------------------------------------------------

--
-- Structure de la table `ticket_parts`
--

CREATE TABLE `ticket_parts` (
  `id` int(10) UNSIGNED NOT NULL,
  `ticket_id` int(10) UNSIGNED NOT NULL,
  `part_number` varchar(255) NOT NULL,
  `purchase_link` text DEFAULT NULL,
  `is_ordered` tinyint(1) NOT NULL DEFAULT 0,
  `expected_delivery_date` date DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Structure de la table `user_machines`
--

CREATE TABLE `user_machines` (
  `user_id` int(11) NOT NULL,
  `machine_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `user_machines`
--

INSERT INTO `user_machines` (`user_id`, `machine_id`) VALUES
(2, 1),
(2, 2),
(2, 3),
(2, 4),
(2, 5),
(3, 1),
(3, 2),
(3, 3),
(3, 4);

-- --------------------------------------------------------

--
-- Structure de la table `user_operator_types`
--

CREATE TABLE `user_operator_types` (
  `user_id` int(10) UNSIGNED NOT NULL,
  `operator_type_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Index pour les tables déchargées
--

--
-- Index pour la table `machines`
--
ALTER TABLE `machines`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

--
-- Index pour la table `maintenance_plans`
--
ALTER TABLE `maintenance_plans`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_maintenance_plans_created_by` (`created_by`),
  ADD KEY `fk_maintenance_plans_machine` (`machine_id`),
  ADD KEY `fk_maintenance_plans_assigned` (`default_assigned_to`);

--
-- Index pour la table `maintenance_tasks`
--
ALTER TABLE `maintenance_tasks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_maintenance_tasks_plan` (`plan_id`),
  ADD KEY `fk_maintenance_tasks_assigned` (`assigned_to`);

--
-- Index pour la table `maintenance_tasks_extra`
--
ALTER TABLE `maintenance_tasks_extra`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_plan_id` (`plan_id`);

--
-- Index pour la table `maintenance_task_time`
--
ALTER TABLE `maintenance_task_time`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_task_id` (`task_id`);

--
-- Index pour la table `operator_types`
--
ALTER TABLE `operator_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

--
-- Index pour la table `tickets`
--
ALTER TABLE `tickets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_tickets_created_by` (`created_by`),
  ADD KEY `fk_tickets_assigned_to` (`assigned_to`);

--
-- Index pour la table `ticket_comments`
--
ALTER TABLE `ticket_comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_tc_ticket` (`ticket_id`),
  ADD KEY `fk_tc_user` (`user_id`);

--
-- Index pour la table `ticket_downtimes`
--
ALTER TABLE `ticket_downtimes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_ticket_id` (`ticket_id`),
  ADD KEY `idx_created_by` (`created_by`);

--
-- Index pour la table `ticket_history`
--
ALTER TABLE `ticket_history`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `ticket_parts`
--
ALTER TABLE `ticket_parts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_ticket_parts_ticket_id` (`ticket_id`),
  ADD KEY `idx_ticket_parts_created_by` (`created_by`);

--
-- Index pour la table `user_machines`
--
ALTER TABLE `user_machines`
  ADD PRIMARY KEY (`user_id`,`machine_id`);

--
-- Index pour la table `user_operator_types`
--
ALTER TABLE `user_operator_types`
  ADD PRIMARY KEY (`user_id`,`operator_type_id`),
  ADD KEY `fk_uot_operator` (`operator_type_id`);

--
-- AUTO_INCREMENT pour les tables déchargées
--

--
-- AUTO_INCREMENT pour la table `machines`
--
ALTER TABLE `machines`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT pour la table `maintenance_plans`
--
ALTER TABLE `maintenance_plans`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;

--
-- AUTO_INCREMENT pour la table `maintenance_tasks`
--
ALTER TABLE `maintenance_tasks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=251;

--
-- AUTO_INCREMENT pour la table `maintenance_tasks_extra`
--
ALTER TABLE `maintenance_tasks_extra`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT pour la table `maintenance_task_time`
--
ALTER TABLE `maintenance_task_time`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT pour la table `operator_types`
--
ALTER TABLE `operator_types`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT pour la table `tickets`
--
ALTER TABLE `tickets`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT pour la table `ticket_comments`
--
ALTER TABLE `ticket_comments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT pour la table `ticket_downtimes`
--
ALTER TABLE `ticket_downtimes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT pour la table `ticket_history`
--
ALTER TABLE `ticket_history`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68;

--
-- AUTO_INCREMENT pour la table `ticket_parts`
--
ALTER TABLE `ticket_parts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Contraintes pour les tables déchargées
--

--
-- Contraintes pour la table `maintenance_plans`
--
ALTER TABLE `maintenance_plans`
  ADD CONSTRAINT `fk_maintenance_plans_assigned` FOREIGN KEY (`default_assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_maintenance_plans_created_by` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_maintenance_plans_machine` FOREIGN KEY (`machine_id`) REFERENCES `machines` (`id`) ON UPDATE CASCADE;

--
-- Contraintes pour la table `maintenance_tasks`
--
ALTER TABLE `maintenance_tasks`
  ADD CONSTRAINT `fk_maintenance_tasks_assigned` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_maintenance_tasks_plan` FOREIGN KEY (`plan_id`) REFERENCES `maintenance_plans` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Contraintes pour la table `tickets`
--
ALTER TABLE `tickets`
  ADD CONSTRAINT `fk_tickets_assigned_to` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `fk_tickets_created_by` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Contraintes pour la table `ticket_comments`
--
ALTER TABLE `ticket_comments`
  ADD CONSTRAINT `fk_tc_ticket` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_tc_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `ticket_parts`
--
ALTER TABLE `ticket_parts`
  ADD CONSTRAINT `fk_ticket_parts_ticket` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_ticket_parts_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Contraintes pour la table `user_operator_types`
--
ALTER TABLE `user_operator_types`
  ADD CONSTRAINT `fk_uot_operator` FOREIGN KEY (`operator_type_id`) REFERENCES `operator_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_uot_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

