text: -- phpMyAdmin SQL Dump
  -- version 4.5.1
  -- http://www.phpmyadmin.net
  --
  -- Client :  127.0.0.1
  -- Généré le :  Sam 13 Mai 2017 à 16:28
  -- Version du serveur :  10.1.19-MariaDB
  -- Version de PHP :  5.6.28
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  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 :  `PFA`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `ads`
  --
  
  CREATE TABLE `ads` (
    `id` int(10) UNSIGNED NOT NULL,
    `titre` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `video` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `begin` timestamp NULL DEFAULT NULL,
    `end` timestamp NULL DEFAULT NULL,
    `company_id` int(10) UNSIGNED NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Contenu de la table `ads`
  --
  
  INSERT INTO `ads` (`id`, `titre`, `video`, `begin`, `end`, `company_id`, `created_at`, `updated_at`) VALUES
  (4, 'test', 'video-1.mp4', '2017-05-13 14:00:00', '2017-05-13 16:00:00', 1, '2017-05-13 14:13:19', '2017-05-13 14:13:19');
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `ad_bus`
  --
  
  CREATE TABLE `ad_bus` (
    `ad_id` int(10) UNSIGNED NOT NULL,
    `bus_id` int(10) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Contenu de la table `ad_bus`
  --
  
  INSERT INTO `ad_bus` (`ad_id`, `bus_id`) VALUES
  (4, 1),
  (4, 2);
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `buses`
  --
  
  CREATE TABLE `buses` (
    `id` int(10) UNSIGNED NOT NULL,
    `reference` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `pickup` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `drop` text 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;
  
  --
  -- Contenu de la table `buses`
  --
  
  INSERT INTO `buses` (`id`, `reference`, `pickup`, `drop`, `created_at`, `updated_at`) VALUES
  (1, '27', 'Tunis', 'Djerba', '2017-05-13 10:00:19', '2017-05-13 10:00:19'),
  (2, '102', 'Tunis', 'Nabeul', '2017-05-13 14:09:52', '2017-05-13 14:09:52');
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `companies`
  --
  
  CREATE TABLE `companies` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `logo` text 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;
  
  --
  -- Contenu de la table `companies`
  --
  
  INSERT INTO `companies` (`id`, `name`, `description`, `logo`, `created_at`, `updated_at`) VALUES
  (1, 'Samsung', 'Société techologie', '1494673236.jpg', '2017-05-13 10:00:36', '2017-05-13 10:00:36');
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Contenu 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_resets_table', 1),
  (3, '2017_05_13_084157_add_votes_to_buses_table', 1),
  (4, '2017_05_13_084213_add_votes_to_companies_table', 1),
  (5, '2017_05_13_084234_add_votes_to_ads_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Structure de la table `users`
  --
  
  CREATE TABLE `users` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `company_id` int(10) UNSIGNED DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Contenu de la table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`, `company_id`) VALUES
  (1, 'Zied bouhejba', 'bouhejbazied@gmail.com', '$2y$10$guRIGJZOErHHu.B82qa.WuhCeuXpyz0d5JiJeZgkDZTOAUfxe1xHy', '8XN1kxVVZzTyOcPA559p44vE7iCGmJOqbOvjETvdPosfKN5LU1dygFzK87N9', '2017-05-13 10:00:00', '2017-05-13 10:00:00', NULL),
  (2, 'Ahmed', 'ahmed@test.com', '$2y$10$/49g4xr9SyALM0zflp5uZeF/zyuLnU45l4jAvvcGoEkDDue3mge.2', 'AeZItiopBX107xMn6fsIKcQeExn6Mm0Dmz6xPg04Ht1nsBeg5UjvmiIW6cBd', '2017-05-13 12:02:25', '2017-05-13 12:02:25', 1);
  
  --
  -- Index pour les tables exportées
  --
  
  --
  -- Index pour la table `ads`
  --
  ALTER TABLE `ads`
    ADD PRIMARY KEY (`id`),
    ADD KEY `ads_company_id_foreign` (`company_id`);
  
  --
  -- Index pour la table `ad_bus`
  --
  ALTER TABLE `ad_bus`
    ADD KEY `ad_bus_ad_id_foreign` (`ad_id`),
    ADD KEY `ad_bus_bus_id_foreign` (`bus_id`);
  
  --
  -- Index pour la table `buses`
  --
  ALTER TABLE `buses`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Index pour la table `companies`
  --
  ALTER TABLE `companies`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Index pour la table `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Index pour la table `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Index pour la table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`),
    ADD KEY `users_company_id_foreign` (`company_id`);
  
  --
  -- AUTO_INCREMENT pour les tables exportées
  --
  
  --
  -- AUTO_INCREMENT pour la table `ads`
  --
  ALTER TABLE `ads`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  --
  -- AUTO_INCREMENT pour la table `buses`
  --
  ALTER TABLE `buses`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  --
  -- AUTO_INCREMENT pour la table `companies`
  --
  ALTER TABLE `companies`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  --
  -- AUTO_INCREMENT pour la table `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  --
  -- AUTO_INCREMENT pour la table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  --
  -- Contraintes pour les tables exportées
  --
  
  --
  -- Contraintes pour la table `ads`
  --
  ALTER TABLE `ads`
    ADD CONSTRAINT `ads_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`);
  
  --
  -- Contraintes pour la table `ad_bus`
  --
  ALTER TABLE `ad_bus`
    ADD CONSTRAINT `ad_bus_ad_id_foreign` FOREIGN KEY (`ad_id`) REFERENCES `ads` (`id`),
    ADD CONSTRAINT `ad_bus_bus_id_foreign` FOREIGN KEY (`bus_id`) REFERENCES `buses` (`id`);
  
  --
  -- Contraintes pour la table `users`
  --
  ALTER TABLE `users`
    ADD CONSTRAINT `users_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`);
  
  /*!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 */;
  