-- https://www.phpmyadmin.net/
--
-- Hôte : jafrchesedipal.mysql.db
-- Généré le : jeu. 21 mai 2026 à 00:02
-- Version du serveur : 8.0.45-36
-- Version de PHP : 8.1.33

START TRANSACTION;



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

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

--
-- Structure de la table `categories`
--

CREATE TABLE `categories` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` 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 `categories`
--

INSERT INTO `categories` (`id`, `nom`, `image`, `created_at`, `updated_at`) VALUES
(1, 'Batiment', '1716223811.jpg', '2024-05-20 16:50:11', '2024-05-20 16:50:11'),
(7, 'Création et Couture', '1716491761.jpg', '2024-05-23 19:16:01', '2025-01-02 11:01:21'),
(8, 'Entretiien et Nettoyage', '1735813595.jpeg', '2025-01-02 09:26:35', '2025-01-02 09:26:35'),
(9, 'Assistance medicale', '1735819615.png', '2025-01-02 11:06:55', '2025-01-02 11:06:55'),
(10, 'Agriculture /Agrobusiness', '1735820032.jpeg', '2025-01-02 11:13:52', '2025-01-02 11:13:52');

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

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

CREATE TABLE `failed_jobs` (
  `id` bigint UNSIGNED NOT NULL,
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext CHARACTER SET utf8mb4 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 `migrations`
--

CREATE TABLE `migrations` (
  `id` int UNSIGNED NOT NULL,
  `migration` varchar(255) CHARACTER SET utf8mb4 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, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_reset_tokens_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2024_05_12_215901_create_categories_table', 1),
(6, '2024_05_19_201337_create_sous_categories_table', 1),
(7, '2024_05_19_201357_create_ouvriers_table', 1),
(8, '2024_05_19_201420_create_clients_table', 1),
(9, '2024_05_19_201439_create_reservations_table', 1),
(11, '2024_05_19_201513_create_notations_table', 2),
(12, '2024_05_28_120840_update_table_add_column_to_ouvriers_table', 3),
(13, '2024_05_28_120903_update_table_add_column_to_clients_table', 3),
(14, '2024_06_05_221826_add_column_etat_to_ouvriers_table', 4),
(15, '2024_06_06_155207_add_column_noter_to_reservations_table', 5),
(16, '2024_07_07_133210_add_column_note_to_reservations_table', 6);

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

--
-- Structure de la table `notations`
--

CREATE TABLE `notations` (
  `id` bigint UNSIGNED NOT NULL,
  `note` double NOT NULL,
  `reservation_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 `notations`
--

INSERT INTO `notations` (`id`, `note`, `reservation_id`, `created_at`, `updated_at`) VALUES
(1, 4, 1, '2024-05-27 16:50:25', '2024-05-27 16:50:25'),
(3, 3, 2, '2024-06-06 15:56:13', '2024-06-06 15:56:13'),
(4, 4, 1, '2024-06-06 17:48:43', '2024-06-06 17:48:43'),
(5, 4, 3, '2024-06-07 16:13:58', '2024-06-07 16:13:58'),
(6, 4, 4, '2024-06-10 17:10:21', '2024-06-10 17:10:21'),
(7, 4, 4, '2024-07-06 22:59:56', '2024-07-06 22:59:56'),
(8, 4, 4, '2024-07-07 13:40:24', '2024-07-07 13:40:24');

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

--
-- Structure de la table `reservations`
--

CREATE TABLE `reservations` (
  `id` bigint UNSIGNED NOT NULL,
  `etat` tinyint(1) NOT NULL DEFAULT '0',
  `dater` date DEFAULT NULL,
  `client_id` bigint UNSIGNED NOT NULL,
  `ouvrier_id` bigint UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `noter` tinyint(1) NOT NULL DEFAULT '0',
  `note` double DEFAULT NULL,
  `validation` tinyint(1) NOT NULL DEFAULT '0',
  `modification` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `reservations` (`id`, `etat`, `dater`, `client_id`, `ouvrier_id`, `created_at`, `updated_at`, `noter`, `note`, `validation`, `modification`) VALUES
(1, 1, '2024-05-30', 1, 1, '2024-05-26 21:13:31', '2025-12-16 22:56:06', 1, 5, 1, 0),
(2, 1, '2024-05-23', 1, 1, '2024-05-31 21:12:02', '2025-12-16 22:56:04', 1, 4, 1, 0),
(3, 1, '2024-06-13', 1, 1, '2024-06-06 22:36:24', '2025-12-16 22:56:01', 1, 3, 1, 0),
(4, 1, '2024-06-11', 1, 1, '2024-06-10 17:06:55', '2025-12-16 22:56:00', 0, 0, 1, 0),
(5, 1, '2024-07-16', 1, 1, '2024-07-07 15:36:38', '2025-12-16 22:55:58', 0, 0, 1, 0),
(6, 1, '2024-07-26', 1, 1, '2024-07-07 19:22:58', '2025-12-16 22:55:47', 0, 0, 1, 1),
(7, 1, '2025-12-16', 8, 1, '2025-12-16 22:05:50', '2025-12-16 23:01:40', 0, 0, 1, 0),
(8, 1, '2025-12-22', 8, 1, '2025-12-19 16:06:12', '2025-12-19 23:17:31', 0, 0, 1, 0),
(9, 0, '2026-01-30', 10, 1, '2026-01-27 19:53:57', '2026-01-27 19:53:57', 0, 0, 0, 0),
(10, 1, '2026-01-31', 10, 7, '2026-01-27 19:54:08', '2026-05-12 12:15:53', 0, 0, 1, 0),
(11, 1, '2026-01-28', 11, 1, '2026-01-28 12:27:20', '2026-02-27 02:13:33', 0, 0, 1, 0),
(12, 1, '2026-01-30', 12, 1, '2026-01-28 12:36:34', '2026-02-27 02:16:09', 0, 0, 1, 0),
(13, 0, '2026-05-04', 13, 1, '2026-05-01 16:08:36', '2026-05-01 16:08:36', 0, 0, 0, 0),
(14, 0, '2026-05-07', 15, 1, '2026-05-05 10:33:05', '2026-05-05 10:33:05', 0, 0, 0, 0),
(15, 0, '2026-05-20', 13, 1, '2026-05-12 12:15:05', '2026-05-12 12:15:05', 0, 0, 0, 0),
(16, 0, '2026-05-15', 16, 2, '2026-05-14 16:56:09', '2026-05-14 16:56:09', 0, 0, 0, 0),
(17, 0, '2026-05-30', 16, 21, '2026-05-14 16:56:48', '2026-05-14 16:56:48', 0, 0, 0, 0);

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

--
-- Structure de la table `sous_categories`
--

CREATE TABLE `sous_categories` (
  `id` bigint UNSIGNED NOT NULL,
  `nom` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `categorie_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 `sous_categories`
--

INSERT INTO `sous_categories` (`id`, `nom`, `image`, `categorie_id`, `created_at`, `updated_at`) VALUES
(1, 'Maconneries', '1716227574.jpg', 1, '2024-05-20 17:52:54', '2024-05-20 17:56:24'),
(2, 'Plomberie', '1716491464.jpg', 1, '2024-05-23 19:11:04', '2024-05-23 19:11:04'),
(14, 'Peintre', '1735817890.jpeg', 1, '2025-01-02 10:38:10', '2025-01-02 10:38:10'),
(15, 'Installation Electrique', '1735818015.jpeg', 1, '2025-01-02 10:40:15', '2025-01-02 10:40:15'),
(16, 'Architecture et Plan', '1735818309.jpeg', 1, '2025-01-02 10:45:09', '2025-01-02 10:45:09'),
(17, 'Carrelage et Marbre', '1735818396.jpeg', 1, '2025-01-02 10:46:36', '2025-01-02 10:46:36'),
(18, 'Charpenterie', '1735819136.jpeg', 1, '2025-01-02 10:58:56', '2025-01-02 10:58:56'),
(20, 'Ambulancier', '1735819786.jpeg', 9, '2025-01-02 11:09:46', '2025-01-02 11:09:46'),
(21, 'Infirmiére / Infirmier', '1735819868.jpeg', 9, '2025-01-02 11:11:08', '2025-01-02 11:11:08'),
(22, 'Maitre Tailleur', '1735821474.jpeg', 7, '2025-01-02 11:37:54', '2025-01-02 11:37:54'),
(23, 'Styliste', '1735822828.jpeg', 7, '2025-01-02 12:00:28', '2025-01-02 12:00:28');

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

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

--
-- 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 `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `notations`
--
ALTER TABLE `notations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notations_reservation_id_foreign` (`reservation_id`);

--
-- Index pour la table `reservations`
--
ALTER TABLE `reservations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `reservations_client_id_foreign` (`client_id`),
  ADD KEY `reservations_ouvrier_id_foreign` (`ouvrier_id`);

--
-- Index pour la table `sous_categories`
--
ALTER TABLE `sous_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sous_categories_categorie_id_foreign` (`categorie_id`);

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

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

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

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

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

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

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

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

--
-- Contraintes pour la table `notations`
--
ALTER TABLE `notations`
  ADD CONSTRAINT `notations_reservation_id_foreign` FOREIGN KEY (`reservation_id`) REFERENCES `reservations` (`id`);

--
-- Contraintes pour la table `reservations`
--
ALTER TABLE `reservations`
  ADD CONSTRAINT `reservations_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`),
  ADD CONSTRAINT `reservations_ouvrier_id_foreign` FOREIGN KEY (`ouvrier_id`) REFERENCES `ouvriers` (`id`);

--
-- Contraintes pour la table `sous_categories`
--
ALTER TABLE `sous_categories`
  ADD CONSTRAINT `sous_categories_categorie_id_foreign` FOREIGN KEY (`categorie_id`) REFERENCES `categories` (`id`);
COMMIT;

