-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mar. 24 fév. 2026 à 21:56
-- Version du serveur : 8.4.3
-- Version de PHP : 8.4.12

START TRANSACTION;



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

--
-- Structure de la table `consommations_mensuelles`
--

CREATE TABLE `consommations_mensuelles` (
  `id` bigint UNSIGNED NOT NULL,
  `unite_id` bigint UNSIGNED NOT NULL,
  `mois` tinyint UNSIGNED NOT NULL,
  `annee` smallint UNSIGNED NOT NULL,
  `electricite` decimal(15,2) NOT NULL DEFAULT '0.00',
  `diesel` decimal(15,2) NOT NULL DEFAULT '0.00',
  `solaire` decimal(15,2) NOT NULL DEFAULT '0.00',
  `hfo` decimal(15,2) NOT NULL DEFAULT '0.00',
  `commentaire` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `consommations_mensuelles` (`id`, `unite_id`, `mois`, `annee`, `electricite`, `diesel`, `solaire`, `hfo`, `commentaire`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 2026, '10000.00', '0.00', '0.00', '0.00', NULL, '2026-02-24 03:51:03', '2026-02-24 03:51:03'),
(2, 2, 1, 2026, '0.00', '0.00', '150000.00', '0.00', NULL, '2026-02-24 03:51:40', '2026-02-24 07:56:36'),
(3, 3, 1, 2026, '0.00', '0.00', '0.00', '850.00', NULL, '2026-02-24 03:52:24', '2026-02-24 06:48:12'),
(4, 4, 1, 2026, '90000.00', '0.00', '0.00', '0.00', NULL, '2026-02-24 03:52:49', '2026-02-24 07:55:39'),
(5, 1, 2, 2026, '100000.00', '0.00', '0.00', '0.00', NULL, '2026-02-24 07:51:19', '2026-02-24 07:57:16'),
(6, 2, 2, 2026, '0.00', '0.00', '400000.00', '0.00', NULL, '2026-02-24 07:51:36', '2026-02-24 07:55:22'),
(7, 3, 2, 2026, '0.00', '0.00', '0.00', '200000.00', NULL, '2026-02-24 07:51:50', '2026-02-24 07:55:13'),
(8, 4, 2, 2026, '250000.00', '0.00', '0.00', '0.00', NULL, '2026-02-24 07:52:03', '2026-02-24 07:54:58'),
(9, 5, 1, 2026, '400000.00', '0.00', '0.00', '0.00', NULL, '2026-02-24 21:46:42', '2026-02-24 21:46:42'),
(10, 5, 2, 2026, '200000.00', '0.00', '0.00', '0.00', NULL, '2026-02-24 21:47:05', '2026-02-24 21:47:05'),
(11, 6, 1, 2026, '0.00', '0.00', '300000.00', '0.00', NULL, '2026-02-24 21:49:42', '2026-02-24 21:49:42'),
(12, 6, 2, 2026, '0.00', '0.00', '400000.00', '0.00', NULL, '2026-02-24 21:50:15', '2026-02-24 21:50:15');

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

--
-- Structure de la table `directions`
--

CREATE TABLE `directions` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `responsable` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint UNSIGNED NOT NULL,
  `reserved_at` int UNSIGNED DEFAULT NULL,
  `available_at` int UNSIGNED NOT NULL,
  `created_at` int UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `menus`
--

CREATE TABLE `menus` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `icone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ordre` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `menus` (`id`, `nom`, `slug`, `label`, `icone`, `ordre`, `created_at`, `updated_at`) VALUES
(1, 'dashboard', 'dashboard', 'Dashboard', NULL, 0, '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(2, 'directions', 'directions', 'Directions', NULL, 0, '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(3, 'services', 'services', 'Services', NULL, 0, '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(4, 'projets', 'projets', 'Projets', NULL, 0, '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(5, 'activites', 'activites', 'Activites', NULL, 0, '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(6, 'utilisateurs', 'utilisateurs', 'Utilisateurs', NULL, 0, '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(7, 'Roles', 'roles', 'Roles', NULL, 0, '2026-02-21 04:05:55', '2026-02-21 04:05:55');

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

--
-- Structure de la table `migrations`
--

CREATE TABLE `migrations` (
  `id` int UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_09_05_003752_create_directions_table', 1),
(5, '2025_09_05_004357_create_services_table', 1),
(6, '2025_09_05_004958_add_role_direction_service_to_users_table', 1),
(7, '2025_09_05_005905_add_photo_to_users_table', 1),
(8, '2025_09_06_005309_create_roles_table', 1),
(9, '2025_09_06_005324_create_menus_table', 1),
(10, '2025_09_06_005335_create_permissions_table', 1),
(11, '2025_09_06_005712_add_role_id_to_users_table', 1),
(12, '2025_09_06_012247_add_label_to_menus_table', 1),
(13, '2025_09_06_054318_remove_role_from_users_table', 1),
(14, '2025_09_06_065339_update_permissions_enum_type', 1),
(15, '2025_09_06_173343_add_phone_to_users_table', 1),
(16, '2026_02_24_004547_create_zones_table', 2),
(17, '2026_02_24_004700_create_unites_industrielles_table', 2),
(18, '2026_02_24_004800_create_consommations_mensuelles_table', 2);

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

--
-- Structure de la table `permissions`
--

CREATE TABLE `permissions` (
  `id` bigint UNSIGNED NOT NULL,
  `role_id` bigint UNSIGNED NOT NULL,
  `menu_id` bigint UNSIGNED NOT NULL,
  `type` enum('lecture','ecriture','inaccessible') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'lecture',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `permissions` (`id`, `role_id`, `menu_id`, `type`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 'ecriture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(2, 2, 1, 'lecture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(3, 1, 2, 'ecriture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(4, 2, 2, 'lecture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(5, 1, 3, 'ecriture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(6, 2, 3, 'lecture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(7, 1, 4, 'ecriture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(8, 2, 4, 'lecture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(9, 1, 5, 'ecriture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(10, 2, 5, 'lecture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(11, 1, 6, 'ecriture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(12, 2, 6, 'lecture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(13, 1, 7, 'ecriture', '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(14, 2, 7, 'lecture', '2026-02-21 04:05:55', '2026-02-21 04:05:55');

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

--
-- Structure de la table `prefectures_guinee`
--

CREATE TABLE `prefectures_guinee` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `hc_keys` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `prefectures_guinee` (`id`, `nom`, `hc_keys`, `region`, `created_at`, `updated_at`) VALUES
(1, 'Conakry', 'gn-3423', 'Conakry', NULL, NULL),
(2, 'Kindia', 'gn-3420', 'Kindia', NULL, NULL),
(3, 'Coyah', 'gn-7096', 'Kindia', NULL, NULL),
(4, 'Forécariah', 'gn-7097', 'Kindia', NULL, NULL),
(5, 'Dubréka', 'gn-7095', 'Kindia', NULL, NULL),
(6, 'Télimélé', 'gn-7112', 'Kindia', NULL, NULL),
(7, 'Boké', 'gn-3419', 'Boké', NULL, NULL),
(8, 'Fria', 'gn-7090', 'Boké', NULL, NULL),
(9, 'Boffa', 'gn-7089', 'Boké', NULL, NULL),
(10, 'Gaoual', 'gn-7087', 'Boké', NULL, NULL),
(11, 'Koundara', 'gn-7088', 'Boké', NULL, NULL),
(12, 'Mamou', 'gn-3418', 'Mamou', NULL, NULL),
(13, 'Dalaba', 'gn-7098', 'Mamou', NULL, NULL),
(14, 'Pita', 'gn-7099', 'Mamou', NULL, NULL),
(15, 'Labé', 'gn-3416', 'Labé', NULL, NULL),
(16, 'Lélouma', 'gn-7094', 'Labé', NULL, NULL),
(17, 'Mali', 'gn-7091', 'Labé', NULL, NULL),
(18, 'Tougué', 'gn-7093', 'Labé', NULL, NULL),
(19, 'Koubia', 'gn-7092', 'Labé', NULL, NULL),
(20, 'Faranah', 'gn-3422', 'Faranah', NULL, NULL),
(21, 'Dabola', 'gn-7100', 'Faranah', NULL, NULL),
(22, 'Dinguiraye', 'gn-7102', 'Faranah', NULL, NULL),
(23, 'Kissidougou', 'gn-7101', 'Faranah', NULL, NULL),
(24, 'Kankan', 'gn-3417', 'Kankan', NULL, NULL),
(25, 'Kérouané', 'gn-7106', 'Kankan', NULL, NULL),
(26, 'Kouroussa', 'gn-7103', 'Kankan', NULL, NULL),
(27, 'Mandiana', 'gn-7105', 'Kankan', NULL, NULL),
(28, 'Siguiri', 'gn-7104', 'Kankan', NULL, NULL),
(29, 'N’Zérékoré', 'gn-nz', 'N’Zérékoré', NULL, NULL),
(30, 'Guéckédou', 'gn-7108', 'N’Zérékoré', NULL, NULL),
(31, 'Macenta', 'gn-7109', 'N’Zérékoré', NULL, NULL),
(32, 'Yomou', 'gn-7107', 'N’Zérékoré', NULL, NULL),
(33, 'Lola', 'gn-7111', 'N’Zérékoré', NULL, NULL),
(34, 'Beyla', 'gn-7110', 'N’Zérékoré', NULL, NULL);

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

--
-- Structure de la table `roles`
--

CREATE TABLE `roles` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` (`id`, `nom`, `label`, `description`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'Administrateur', NULL, '2026-02-21 04:05:55', '2026-02-21 04:05:55'),
(2, 'consultant', 'Consultant', NULL, '2026-02-21 04:05:55', '2026-02-21 04:05:55');

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

--
-- Structure de la table `services`
--

CREATE TABLE `services` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `direction_id` bigint UNSIGNED NOT NULL,
  `responsable` bigint UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Structure de la table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('glrQ7kptsWwt4hVC2XdZt3dnA96FXIk74dx1mWzP', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiQ2RqQjNOalR0YTBLZHpqejVVRkFOMEJqYkZFelh3Z2UyWlJkdnd0cyI7czozOiJ1cmwiO2E6MDp7fXM6OToiX3ByZXZpb3VzIjthOjE6e3M6MzoidXJsIjtzOjM2OiJodHRwOi8vc3VpdmktdW5pdGUtaW5kdXN0cmllbGxlLnRlc3QiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1771969997);

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

--
-- Structure de la table `unites_industrielles`
--

CREATE TABLE `unites_industrielles` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone_id` bigint UNSIGNED NOT NULL,
  `energy_type` enum('electricite','diesel','solaire','hfo') COLLATE utf8mb4_unicode_ci NOT NULL,
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `status` enum('actif','inactif') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'actif',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `unites_industrielles` (`id`, `name`, `zone_id`, `energy_type`, `latitude`, `longitude`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Agro - Kindia', 2, 'electricite', '10.0254000', '-12.8101000', 'actif', '2026-02-24 01:20:06', '2026-02-24 01:20:06'),
(2, 'Mine - Kankan', 3, 'solaire', '10.3020000', '-9.2720000', 'actif', '2026-02-24 01:21:57', '2026-02-24 01:21:57'),
(3, 'Usine - Nzérékoré', 4, 'hfo', '7.6640000', '-8.7670000', 'actif', '2026-02-24 01:22:39', '2026-02-24 01:22:39'),
(4, 'Cimenterie - Coyah', 5, 'electricite', '9.7052000', '-13.3865000', 'actif', '2026-02-24 01:23:55', '2026-02-24 01:23:55'),
(5, 'Unité d\'eau Faranah', 6, 'electricite', '9.9780000', '-10.7450000', 'actif', '2026-02-24 21:46:05', '2026-02-24 21:46:05'),
(6, 'Unité de LABE', 7, 'solaire', '11.3060000', '-12.2280000', 'actif', '2026-02-24 21:49:16', '2026-02-24 21:49:16');

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

--
-- Structure de la table `zones`
--

CREATE TABLE `zones` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `prefecture_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `zones` (`id`, `nom`, `prefecture_id`, `created_at`, `updated_at`) VALUES
(1, 'Conakry', 1, NULL, NULL),
(2, 'Kindia', 2, NULL, NULL),
(3, 'Kankan', 24, NULL, NULL),
(4, 'N\'Zérékoré', 29, NULL, NULL),
(5, 'Coyah', 3, NULL, NULL),
(6, 'Faranah', 20, NULL, NULL),
(7, 'Labé', 15, NULL, NULL);

--
-- Index pour la table `consommations_mensuelles`
--
ALTER TABLE `consommations_mensuelles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `consommations_mensuelles_unite_id_mois_annee_unique` (`unite_id`,`mois`,`annee`),
  ADD KEY `consommations_mensuelles_annee_mois_index` (`annee`,`mois`);

--
-- Index pour la table `directions`
--
ALTER TABLE `directions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `directions_responsable_foreign` (`responsable`);

--
-- Index pour la table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Index pour la table `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

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

--
-- Index pour la table `menus`
--
ALTER TABLE `menus`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `menus_slug_unique` (`slug`);

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

--
-- Index pour la table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `permissions_role_id_menu_id_unique` (`role_id`,`menu_id`),
  ADD KEY `permissions_menu_id_foreign` (`menu_id`);

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

--
-- Index pour la table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `roles_nom_unique` (`nom`);

--
-- Index pour la table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `services_direction_id_foreign` (`direction_id`),
  ADD KEY `services_responsable_foreign` (`responsable`);

--
-- Index pour la table `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Index pour la table `unites_industrielles`
--
ALTER TABLE `unites_industrielles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `unites_industrielles_zone_id_energy_type_index` (`zone_id`,`energy_type`);

--
-- Index pour la table `zones`
--
ALTER TABLE `zones`
  ADD PRIMARY KEY (`id`),
  ADD KEY `zones_prefecture_id_foreign` (`prefecture_id`);

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

--
-- AUTO_INCREMENT pour la table `consommations_mensuelles`
--
ALTER TABLE `consommations_mensuelles`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT pour la table `directions`
--
ALTER TABLE `directions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `menus`
--
ALTER TABLE `menus`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT pour la table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT pour la table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT pour la table `prefectures_guinee`
--
ALTER TABLE `prefectures_guinee`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT pour la table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT pour la table `services`
--
ALTER TABLE `services`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT pour la table `unites_industrielles`
--
ALTER TABLE `unites_industrielles`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT pour la table `zones`
--
ALTER TABLE `zones`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

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

--
-- Contraintes pour la table `consommations_mensuelles`
--
ALTER TABLE `consommations_mensuelles`
  ADD CONSTRAINT `consommations_mensuelles_unite_id_foreign` FOREIGN KEY (`unite_id`) REFERENCES `unites_industrielles` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `directions`
--
ALTER TABLE `directions`
  ADD CONSTRAINT `directions_responsable_foreign` FOREIGN KEY (`responsable`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Contraintes pour la table `permissions`
--
ALTER TABLE `permissions`
  ADD CONSTRAINT `permissions_menu_id_foreign` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `services`
--
ALTER TABLE `services`
  ADD CONSTRAINT `services_direction_id_foreign` FOREIGN KEY (`direction_id`) REFERENCES `directions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `services_responsable_foreign` FOREIGN KEY (`responsable`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Contraintes pour la table `unites_industrielles`
--
ALTER TABLE `unites_industrielles`
  ADD CONSTRAINT `unites_industrielles_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `zones`
--
ALTER TABLE `zones`
  ADD CONSTRAINT `zones_prefecture_id_foreign` FOREIGN KEY (`prefecture_id`) REFERENCES `prefectures_guinee` (`id`) ON DELETE CASCADE;
COMMIT;

