text: -- phpMyAdmin SQL Dump
  -- version 4.6.4
  -- https://www.phpmyadmin.net/
  --
  -- Host: localhost:3306
  -- Generation Time: Aug 06, 2018 at 11:47 AM
  -- Server version: 10.1.9-MariaDB-log
  -- PHP Version: 7.0.10
  
  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 */;
  
  --
  -- Database: `larapus`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `authorrs`
  --
  
  CREATE TABLE `authorrs` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) 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;
  
  --
  -- Dumping data for table `authorrs`
  --
  
  INSERT INTO `authorrs` (`id`, `name`, `created_at`, `updated_at`) VALUES
  (1, 'Mohammad Fauzil Adhim', '2018-07-31 23:48:09', '2018-07-31 23:48:09'),
  (2, 'Salim A. Fillah', '2018-07-31 23:48:09', '2018-07-31 23:48:09'),
  (3, 'Aam Amiruddin', '2018-07-31 23:48:09', '2018-07-31 23:48:09'),
  (4, 'M Junika Berli', '2018-08-03 03:15:36', '2018-08-03 03:15:36');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `boooks`
  --
  
  CREATE TABLE `boooks` (
    `id` int(10) UNSIGNED NOT NULL,
    `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `author_id` int(10) UNSIGNED NOT NULL,
    `amount` int(10) UNSIGNED NOT NULL,
    `cover` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `boooks`
  --
  
  INSERT INTO `boooks` (`id`, `title`, `author_id`, `amount`, `cover`, `created_at`, `updated_at`) VALUES
  (1, 'Kupinang Engkau dengan Hamdalah', 1, 3, NULL, '2018-07-31 23:48:09', '2018-07-31 23:48:09'),
  (2, 'Jalan Cinta Para Pejuang', 2, 2, NULL, '2018-07-31 23:48:09', '2018-07-31 23:48:09'),
  (3, 'Membingkai Surga dalam Rumah Tangga', 3, 4, NULL, '2018-07-31 23:48:09', '2018-07-31 23:48:09'),
  (4, 'Cinta & Seks Rumah Tangga Muslim', 3, 3, NULL, '2018-07-31 23:48:09', '2018-07-31 23:48:09'),
  (7, 'ketika cinta bertasbih', 4, 5, '0b13f77edc7825a2bb873a48d48e694a.jpg', '2018-08-03 03:18:05', '2018-08-03 03:18:06'),
  (8, 'ketika cinta bertasbih 2', 4, 5, 'c8d19be3c8c101a515cdf9537df16b51.jpg', '2018-08-03 03:19:04', '2018-08-03 03:19:06');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `borrow_logs`
  --
  
  CREATE TABLE `borrow_logs` (
    `id` int(10) UNSIGNED NOT NULL,
    `book_id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `is_returned` tinyint(1) 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;
  
  --
  -- Dumping data for table `borrow_logs`
  --
  
  INSERT INTO `borrow_logs` (`id`, `book_id`, `user_id`, `is_returned`, `created_at`, `updated_at`) VALUES
  (1, 1, 2, 1, '2018-07-31 23:48:10', '2018-08-03 03:21:58'),
  (2, 2, 2, 1, '2018-07-31 23:48:10', '2018-08-03 03:22:04'),
  (3, 3, 2, 1, '2018-07-31 23:48:10', '2018-07-31 23:48:10'),
  (4, 7, 5, 1, '2018-08-03 03:21:03', '2018-08-03 18:37:32'),
  (5, 8, 5, 1, '2018-08-03 03:21:13', '2018-08-03 18:37:40'),
  (6, 7, 2, 1, '2018-08-03 03:22:18', '2018-08-03 18:36:29'),
  (7, 8, 2, 1, '2018-08-03 03:22:27', '2018-08-03 18:36:34');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `migrations`
  --
  
  INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
  (7, '2014_10_12_000000_create_users_table', 1),
  (8, '2014_10_12_100000_create_password_resets_table', 1),
  (9, '2018_07_26_085016_laratrust_setup_tables', 1),
  (10, '2018_07_27_063746_create_authorrs_table', 1),
  (11, '2018_07_27_063813_create_boooks_table', 1),
  (12, '2018_07_30_125746_create_borrow_logs_table', 1),
  (13, '2018_08_01_064151_add_verification_to_users', 1),
  (14, '2018_08_04_010152_add_last_login_to_users_table', 2);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `password_resets`
  --
  
  INSERT INTO `password_resets` (`email`, `token`, `created_at`) VALUES
  ('admin@gmail.com', '$2y$10$pY6gBPcqmEOTvoUdUY7m4O17f4E2/XHzy7HGuCKsGlKWF3aHyISmC', '2018-08-01 19:20:54');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `permissions`
  --
  
  CREATE TABLE `permissions` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `permission_role`
  --
  
  CREATE TABLE `permission_role` (
    `permission_id` int(10) UNSIGNED NOT NULL,
    `role_id` int(10) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `permission_user`
  --
  
  CREATE TABLE `permission_user` (
    `permission_id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `user_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `roles`
  --
  
  CREATE TABLE `roles` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `roles`
  --
  
  INSERT INTO `roles` (`id`, `name`, `display_name`, `description`, `created_at`, `updated_at`) VALUES
  (1, 'admin', 'Admin', NULL, '2018-07-31 23:48:07', '2018-07-31 23:48:07'),
  (2, 'member', 'Member', NULL, '2018-07-31 23:48:07', '2018-07-31 23:48:07');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `role_user`
  --
  
  CREATE TABLE `role_user` (
    `role_id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `user_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `role_user`
  --
  
  INSERT INTO `role_user` (`role_id`, `user_id`, `user_type`) VALUES
  (1, 1, 'App\\User'),
  (2, 2, 'App\\User'),
  (2, 5, 'App\\User');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `last_login` timestamp NULL DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `verification_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `is_verified` tinyint(1) NOT NULL DEFAULT '0'
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `last_login`, `created_at`, `updated_at`, `verification_token`, `is_verified`) VALUES
  (1, 'Admin Larapus', 'admin@gmail.com', '$2y$10$eV98YDvvXjQtwm5BZch0R..Y5FKM92VX44wHvaK2On1fYdV81flky', 'bBmiRciviQrneQiuPBBBW3BOYOPYdHXKqdK2CheqVvUHRGHHuAR4ZVOW3iK2', '2018-08-03 18:38:22', '2018-07-31 23:48:08', '2018-08-03 18:38:22', NULL, 1),
  (2, 'Sample Member', 'member@gmail.com', '$2y$10$aRvxcpSdxoO6oS66nMx37uED8bd36nXEgoot5mGQcZ1WoF9pxCaPC', 'M3kWaUy5x20GRFIzLJIApdn0FrgZZ6eiWxTWa1KsJj9BfXPXdsMdt6czUcje', '2018-08-03 18:36:21', '2018-07-31 23:48:09', '2018-08-03 18:36:21', NULL, 1),
  (5, 'junika', 'junika@gmail.com', '$2y$10$wWdeQYO13I9b7gLi0.S2r.m16nXDUVkNkIFOpDvQk6BGmRQJ8rDUO', 'Pi8CrGgLh3Ek29YD6pXfZh490C7Y7IhSz0VOq5Ux9HsMlnaJTrh4aKlrWJ95', '2018-08-03 18:37:26', '2018-08-01 23:49:37', '2018-08-03 18:37:26', NULL, 1);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `authorrs`
  --
  ALTER TABLE `authorrs`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `boooks`
  --
  ALTER TABLE `boooks`
    ADD PRIMARY KEY (`id`),
    ADD KEY `boooks_author_id_foreign` (`author_id`);
  
  --
  -- Indexes for table `borrow_logs`
  --
  ALTER TABLE `borrow_logs`
    ADD PRIMARY KEY (`id`),
    ADD KEY `borrow_logs_book_id_index` (`book_id`),
    ADD KEY `borrow_logs_user_id_index` (`user_id`);
  
  --
  -- Indexes for table `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indexes for table `permissions`
  --
  ALTER TABLE `permissions`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `permissions_name_unique` (`name`);
  
  --
  -- Indexes for table `permission_role`
  --
  ALTER TABLE `permission_role`
    ADD PRIMARY KEY (`permission_id`,`role_id`),
    ADD KEY `permission_role_role_id_foreign` (`role_id`);
  
  --
  -- Indexes for table `permission_user`
  --
  ALTER TABLE `permission_user`
    ADD PRIMARY KEY (`user_id`,`permission_id`,`user_type`),
    ADD KEY `permission_user_permission_id_foreign` (`permission_id`);
  
  --
  -- Indexes for table `roles`
  --
  ALTER TABLE `roles`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `roles_name_unique` (`name`);
  
  --
  -- Indexes for table `role_user`
  --
  ALTER TABLE `role_user`
    ADD PRIMARY KEY (`user_id`,`role_id`,`user_type`),
    ADD KEY `role_user_role_id_foreign` (`role_id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `authorrs`
  --
  ALTER TABLE `authorrs`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  --
  -- AUTO_INCREMENT for table `boooks`
  --
  ALTER TABLE `boooks`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  --
  -- AUTO_INCREMENT for table `borrow_logs`
  --
  ALTER TABLE `borrow_logs`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  --
  -- AUTO_INCREMENT for table `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
  --
  -- AUTO_INCREMENT for table `permissions`
  --
  ALTER TABLE `permissions`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  --
  -- AUTO_INCREMENT for table `roles`
  --
  ALTER TABLE `roles`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `boooks`
  --
  ALTER TABLE `boooks`
    ADD CONSTRAINT `boooks_author_id_foreign` FOREIGN KEY (`author_id`) REFERENCES `authorrs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `borrow_logs`
  --
  ALTER TABLE `borrow_logs`
    ADD CONSTRAINT `borrow_logs_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `boooks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `borrow_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `permission_role`
  --
  ALTER TABLE `permission_role`
    ADD CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `permission_user`
  --
  ALTER TABLE `permission_user`
    ADD CONSTRAINT `permission_user_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `role_user`
  --
  ALTER TABLE `role_user`
    ADD CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  /*!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 */;
  