text: -- phpMyAdmin SQL Dump
  -- version 4.9.0.1
  -- https://www.phpmyadmin.net/
  --
  -- Hôte : 127.0.0.1
  -- Généré le :  mar. 02 fév. 2021 à 10:58
  -- Version du serveur :  10.3.15-MariaDB
  -- Version de PHP :  7.3.6
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  START TRANSACTION;
  SET time_zone = "+00:00";
  
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!40101 SET NAMES utf8mb4 */;
  
  --
  -- Base de données :  `dbtest`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `categories`
  --
  
  CREATE TABLE `categories` (
    `id` bigint(20) NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `status` int(10) NOT 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 `commands`
  --
  
  CREATE TABLE `commands` (
    `id` bigint(20) NOT NULL,
    `user_id` bigint(20) UNSIGNED NOT NULL,
    `num_command` varchar(50) NOT NULL,
    `status` int(10) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `commands_products`
  --
  
  CREATE TABLE `commands_products` (
    `id` bigint(20) NOT NULL,
    `command_id` bigint(20) NOT NULL,
    `product_id` bigint(20) NOT NULL,
    `quantity` int(10) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `images`
  --
  
  CREATE TABLE `images` (
    `id` bigint(20) NOT NULL,
    `product_id` bigint(20) NOT NULL,
    `name` 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=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `logs`
  --
  
  CREATE TABLE `logs` (
    `id` bigint(20) NOT NULL,
    `user_id` bigint(20) UNSIGNED NOT NULL,
    `description` text NOT NULL,
    `info_compl` text NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `model_has_permissions`
  --
  
  CREATE TABLE `model_has_permissions` (
    `permission_id` int(10) UNSIGNED NOT NULL,
    `model_id` int(10) UNSIGNED NOT NULL,
    `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `model_has_roles`
  --
  
  CREATE TABLE `model_has_roles` (
    `role_id` int(10) UNSIGNED NOT NULL,
    `model_id` int(10) UNSIGNED NOT NULL,
    `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Déchargement des données de la table `model_has_roles`
  --
  
  INSERT INTO `model_has_roles` (`role_id`, `model_id`, `model_type`) VALUES
  (1, 1, 'App\\User');
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `permissions`
  --
  
  CREATE TABLE `permissions` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `deleted_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `products`
  --
  
  CREATE TABLE `products` (
    `id` bigint(20) NOT NULL,
    `categorie_id` bigint(20) NOT NULL,
    `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `description` text NOT NULL,
    `status` int(10) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `roles`
  --
  
  CREATE TABLE `roles` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `deleted_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`, `name`, `guard_name`, `description`, `created_at`, `updated_at`, `deleted_at`) VALUES
  (0, 'super_admin', 'web', 'Super administrateur, qui a tous les droits', '2021-02-02 19:05:08', '2021-02-02 19:05:08', NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `role_has_permissions`
  --
  
  CREATE TABLE `role_has_permissions` (
    `permission_id` int(10) UNSIGNED NOT NULL,
    `role_id` int(10) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `login` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `debut` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '00:00',
    `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `fin` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '23:59'
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Déchargement des données de la table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `password`, `number`, `created_at`, `updated_at`, `login`, `debut`, `type`, `fin`) VALUES
  (1, 'superadmin', 'superadmin@test.com', '$2y$10$7eoTESvBlJCzX4H9MjgFD.N0PJ09GJ6m8xbIrXhvxIvKrsQWP/Ywe', NULL, NULL, NULL, NULL, '00:00', 'admin', '23:59');
  
  --
  -- Index pour les tables déchargées
  --
  
  --
  -- Index pour la table `categories`
  --
  ALTER TABLE `categories`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Index pour la table `commands`
  --
  ALTER TABLE `commands`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `num_command` (`num_command`),
    ADD KEY `user_id` (`user_id`);
  
  --
  -- Index pour la table `commands_products`
  --
  ALTER TABLE `commands_products`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `command_id` (`command_id`,`product_id`),
    ADD KEY `product_id` (`product_id`);
  
  --
  -- Index pour la table `images`
  --
  ALTER TABLE `images`
    ADD PRIMARY KEY (`id`),
    ADD KEY `product_id` (`product_id`);
  
  --
  -- Index pour la table `logs`
  --
  ALTER TABLE `logs`
    ADD PRIMARY KEY (`id`),
    ADD KEY `user_id` (`user_id`);
  
  --
  -- Index pour la table `products`
  --
  ALTER TABLE `products`
    ADD PRIMARY KEY (`id`),
    ADD KEY `categorie_id` (`categorie_id`);
  
  --
  -- Index pour la table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT pour les tables déchargées
  --
  
  --
  -- AUTO_INCREMENT pour la table `categories`
  --
  ALTER TABLE `categories`
    MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT pour la table `commands`
  --
  ALTER TABLE `commands`
    MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT pour la table `commands_products`
  --
  ALTER TABLE `commands_products`
    MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT pour la table `images`
  --
  ALTER TABLE `images`
    MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT pour la table `logs`
  --
  ALTER TABLE `logs`
    MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT pour la table `products`
  --
  ALTER TABLE `products`
    MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT pour la table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- Contraintes pour les tables déchargées
  --
  
  --
  -- Contraintes pour la table `commands`
  --
  ALTER TABLE `commands`
    ADD CONSTRAINT `commands_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Contraintes pour la table `commands_products`
  --
  ALTER TABLE `commands_products`
    ADD CONSTRAINT `commands_products_ibfk_1` FOREIGN KEY (`command_id`) REFERENCES `commands` (`id`),
    ADD CONSTRAINT `commands_products_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`);
  
  --
  -- Contraintes pour la table `images`
  --
  ALTER TABLE `images`
    ADD CONSTRAINT `images_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`);
  
  --
  -- Contraintes pour la table `logs`
  --
  ALTER TABLE `logs`
    ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
  
  --
  -- Contraintes pour la table `products`
  --
  ALTER TABLE `products`
    ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`categorie_id`) REFERENCES `categories` (`id`);
  COMMIT;
  
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  