text: -- phpMyAdmin SQL Dump
  -- version 4.8.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Sep 06, 2018 at 08:53 PM
  -- Server version: 10.1.34-MariaDB
  -- PHP Version: 7.2.8
  
  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 */;
  
  --
  -- Database: `bmt`
  --
  
  -- --------------------------------------------------------
  
  --
  -- 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
  (1, '2014_10_12_000000_create_users_table', 1),
  (2, '2014_10_12_100000_create_password_resets_table', 1),
  (3, '2018_09_02_024213_create_permission_tables', 1),
  (4, '2018_09_02_025630_create_simpanans_table', 1),
  (5, '2018_09_04_003233_create_pinjamans_table', 1),
  (6, '2018_09_04_003258_create_pinjaman_details_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `model_has_permissions`
  --
  
  CREATE TABLE `model_has_permissions` (
    `permission_id` int(10) UNSIGNED NOT NULL,
    `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `model_has_roles`
  --
  
  CREATE TABLE `model_has_roles` (
    `role_id` int(10) UNSIGNED NOT NULL,
    `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `model_has_roles`
  --
  
  INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
  (2, 'App\\User', 1),
  (3, 'App\\User', 1);
  
  -- --------------------------------------------------------
  
  --
  -- 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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `permissions`
  --
  
  CREATE TABLE `permissions` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_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 `permissions`
  --
  
  INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
  (1, 'home', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (2, 'simpanan', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (3, 'nasabah', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (4, 'penarikan', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (5, 'pinjaman', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (6, 'roles', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (7, 'laporan', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pinjamans`
  --
  
  CREATE TABLE `pinjamans` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `kode_transaksi` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `jumlah` double(15,2) NOT NULL,
    `durasi` int(11) NOT NULL,
    `tanggal` date NOT NULL,
    `pengelola` 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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pinjaman_details`
  --
  
  CREATE TABLE `pinjaman_details` (
    `id` int(10) UNSIGNED NOT NULL,
    `pinjaman_id` int(10) UNSIGNED NOT NULL,
    `bayar_bulanan` double(15,2) NOT NULL,
    `tanggal` date NOT 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 `roles`
  --
  
  CREATE TABLE `roles` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_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 `roles`
  --
  
  INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
  (1, 'nasabah', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (2, 'pengelola', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43'),
  (3, 'admin', 'web', '2018-09-06 18:52:43', '2018-09-06 18:52:43');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for 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;
  
  --
  -- Dumping data for table `role_has_permissions`
  --
  
  INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
  (1, 1),
  (1, 3),
  (2, 2),
  (2, 3),
  (3, 2),
  (3, 3),
  (4, 2),
  (4, 3),
  (5, 2),
  (5, 3),
  (6, 3),
  (7, 2),
  (7, 3);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `simpanans`
  --
  
  CREATE TABLE `simpanans` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(10) UNSIGNED NOT NULL,
    `jenis` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `kode_transaksi` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `debit` double(15,2) NOT NULL,
    `kredit` double(15,2) NOT NULL,
    `saldo` double(15,2) NOT NULL,
    `tanggal` date NOT NULL,
    `pengelola` 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;
  
  -- --------------------------------------------------------
  
  --
  -- 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,
    `kelamin` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `no_anggota` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `agama` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `identitas` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `no_identitas` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `alamat` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `foto` varchar(191) 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
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `name`, `email`, `password`, `kelamin`, `no_anggota`, `agama`, `identitas`, `no_identitas`, `alamat`, `foto`, `remember_token`, `created_at`, `updated_at`) VALUES
  (1, 'Admin', 'admin@gmail.com', '$2y$10$J2/GDPn8nEMZQSOO1/vnO.tifz.AfYpp9PMZctvF2dnLrflvDPt5a', '', '', '', '', '', '', 'user.png', NULL, '2018-09-06 18:52:43', '2018-09-06 18:52:43');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `model_has_permissions`
  --
  ALTER TABLE `model_has_permissions`
    ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
    ADD KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`);
  
  --
  -- Indexes for table `model_has_roles`
  --
  ALTER TABLE `model_has_roles`
    ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
    ADD KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`);
  
  --
  -- 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`);
  
  --
  -- Indexes for table `pinjamans`
  --
  ALTER TABLE `pinjamans`
    ADD PRIMARY KEY (`id`),
    ADD KEY `pinjamans_user_id_foreign` (`user_id`);
  
  --
  -- Indexes for table `pinjaman_details`
  --
  ALTER TABLE `pinjaman_details`
    ADD PRIMARY KEY (`id`),
    ADD KEY `pinjaman_details_pinjaman_id_foreign` (`pinjaman_id`);
  
  --
  -- Indexes for table `roles`
  --
  ALTER TABLE `roles`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `role_has_permissions`
  --
  ALTER TABLE `role_has_permissions`
    ADD PRIMARY KEY (`permission_id`,`role_id`),
    ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);
  
  --
  -- Indexes for table `simpanans`
  --
  ALTER TABLE `simpanans`
    ADD PRIMARY KEY (`id`),
    ADD KEY `simpanans_user_id_foreign` (`user_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 `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT for table `permissions`
  --
  ALTER TABLE `permissions`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  
  --
  -- AUTO_INCREMENT for table `pinjamans`
  --
  ALTER TABLE `pinjamans`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `pinjaman_details`
  --
  ALTER TABLE `pinjaman_details`
    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=4;
  
  --
  -- AUTO_INCREMENT for table `simpanans`
  --
  ALTER TABLE `simpanans`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `model_has_permissions`
  --
  ALTER TABLE `model_has_permissions`
    ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `model_has_roles`
  --
  ALTER TABLE `model_has_roles`
    ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `pinjamans`
  --
  ALTER TABLE `pinjamans`
    ADD CONSTRAINT `pinjamans_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `pinjaman_details`
  --
  ALTER TABLE `pinjaman_details`
    ADD CONSTRAINT `pinjaman_details_pinjaman_id_foreign` FOREIGN KEY (`pinjaman_id`) REFERENCES `pinjamans` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `role_has_permissions`
  --
  ALTER TABLE `role_has_permissions`
    ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `simpanans`
  --
  ALTER TABLE `simpanans`
    ADD CONSTRAINT `simpanans_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
  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 */;
  