text: -- phpMyAdmin SQL Dump
  -- version 5.0.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Waktu pembuatan: 18 Bulan Mei 2021 pada 08.07
  -- Versi server: 10.4.11-MariaDB
  -- Versi PHP: 7.3.15
  
  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: `db_si_water`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `barangs`
  --
  
  CREATE TABLE `barangs` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `satuan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `stok` bigint(20) NOT 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;
  
  --
  -- Dumping data untuk tabel `barangs`
  --
  
  INSERT INTO `barangs` (`id`, `nama`, `satuan`, `stok`, `created_at`, `updated_at`, `deleted_at`) VALUES
  (1, 'papan', 'plat', 290, '2021-05-16 01:17:35', '2021-05-16 01:21:55', '2021-05-16 01:21:55'),
  (2, 'paku', 'lusin', 800, '2021-05-16 01:18:05', '2021-05-16 01:21:11', NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `barang_keluars`
  --
  
  CREATE TABLE `barang_keluars` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `id_barang` bigint(20) NOT NULL,
    `stok_keluar` bigint(20) NOT NULL,
    `lokasi` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `pengambil` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `fungsi` text COLLATE utf8mb4_unicode_ci NOT 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;
  
  --
  -- Dumping data untuk tabel `barang_keluars`
  --
  
  INSERT INTO `barang_keluars` (`id`, `id_barang`, `stok_keluar`, `lokasi`, `pengambil`, `fungsi`, `created_at`, `updated_at`, `deleted_at`) VALUES
  (1, 1, 10, 'bc4', 'andi', 'pembangunan', '2021-05-16 01:19:54', '2021-05-16 01:20:01', NULL),
  (2, 2, 200, 'V3', 'lili', 'pembangunan', '2021-05-16 01:21:11', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `barang_masuks`
  --
  
  CREATE TABLE `barang_masuks` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `id_barang` bigint(20) NOT NULL,
    `stok_masuk` bigint(20) NOT NULL,
    `lokasi` varchar(255) COLLATE utf8mb4_unicode_ci NOT 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;
  
  --
  -- Dumping data untuk tabel `barang_masuks`
  --
  
  INSERT INTO `barang_masuks` (`id`, `id_barang`, `stok_masuk`, `lokasi`, `created_at`, `updated_at`, `deleted_at`) VALUES
  (1, 1, 100, 'BC-4', '2021-05-16 01:18:37', '2021-05-16 01:18:55', NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `failed_jobs`
  --
  
  CREATE TABLE `failed_jobs` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
    `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `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;
  
  --
  -- Dumping data untuk tabel `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, '2019_08_19_000000_create_failed_jobs_table', 1),
  (4, '2021_03_28_075716_create_permission_tables', 1),
  (5, '2021_04_28_070734_create_barangs_table', 1),
  (6, '2021_05_12_012921_create_barang_masuks_table', 1),
  (7, '2021_05_12_012942_create_barang_keluars_table', 1),
  (8, '2021_05_12_013314_create_requests_table', 1),
  (9, '2021_05_15_100259_create_restoks_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `model_has_permissions`
  --
  
  CREATE TABLE `model_has_permissions` (
    `permission_id` bigint(20) UNSIGNED NOT NULL,
    `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `model_has_roles`
  --
  
  CREATE TABLE `model_has_roles` (
    `role_id` bigint(20) UNSIGNED NOT NULL,
    `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data untuk tabel `model_has_roles`
  --
  
  INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
  (1, 'App\\Models\\User', 1),
  (2, 'App\\Models\\User', 3),
  (3, 'App\\Models\\User', 2);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `password_resets`
  --
  
  CREATE TABLE `password_resets` (
    `email` varchar(255) 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;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `permissions`
  --
  
  CREATE TABLE `permissions` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(255) 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;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `requests`
  --
  
  CREATE TABLE `requests` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `id_barang` bigint(20) NOT NULL,
    `stok` bigint(20) NOT 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;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `restoks`
  --
  
  CREATE TABLE `restoks` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `id_barang` bigint(20) NOT NULL,
    `permintaan_stok` bigint(20) NOT NULL,
    `terpenuhi_stok` bigint(20) 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;
  
  --
  -- Dumping data untuk tabel `restoks`
  --
  
  INSERT INTO `restoks` (`id`, `id_barang`, `permintaan_stok`, `terpenuhi_stok`, `created_at`, `updated_at`, `deleted_at`) VALUES
  (1, 1, 2000, 600, '2021-05-16 01:21:24', '2021-05-16 01:22:12', NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `roles`
  --
  
  CREATE TABLE `roles` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(255) 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 untuk tabel `roles`
  --
  
  INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
  (1, 'admin', 'web', '2021-05-16 01:15:04', '2021-05-16 01:15:04'),
  (2, 'pegawai', 'web', '2021-05-16 01:15:04', '2021-05-16 01:15:04'),
  (3, 'pimpinan', 'web', '2021-05-16 01:15:04', '2021-05-16 01:15:04');
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `role_has_permissions`
  --
  
  CREATE TABLE `role_has_permissions` (
    `permission_id` bigint(20) UNSIGNED NOT NULL,
    `role_id` bigint(20) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `nomor_hp` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `tipe_user` enum('admin','pimpinan','pegawai') 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,
    `deleted_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data untuk tabel `users`
  --
  
  INSERT INTO `users` (`id`, `username`, `nama`, `password`, `nomor_hp`, `tipe_user`, `remember_token`, `created_at`, `updated_at`, `deleted_at`) VALUES
  (1, 'Admin', 'Admin', '$2y$10$onWwJon0nR0ZUT.KD/Abqe9cFsZE3NGGThh97fT0Lge/.A.F2hjVW', '-', 'admin', NULL, '2021-05-16 01:15:04', '2021-05-16 01:15:04', NULL),
  (2, 'yusuf', 'pimpinan 1', '$2y$10$EVwoxbLg1b/ZBKJFZvJNi.UjM.qHVNOi9omgtvpJ2YzuQQHDQkOCS', '0977878', 'pimpinan', NULL, '2021-05-16 01:15:53', '2021-05-16 01:16:06', NULL),
  (3, 'andi', 'pegawai 1', '$2y$10$UKSFVRFDxRkOsAR7UVFmu.qO4XbNDXNblqCUmSYdGcw26NOWwUCNW', '+10823122324', 'pegawai', NULL, '2021-05-16 01:16:23', '2021-05-16 01:20:16', NULL);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indeks untuk tabel `barangs`
  --
  ALTER TABLE `barangs`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `barang_keluars`
  --
  ALTER TABLE `barang_keluars`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `barang_masuks`
  --
  ALTER TABLE `barang_masuks`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
  
  --
  -- Indeks untuk tabel `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `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`);
  
  --
  -- Indeks untuk tabel `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`);
  
  --
  -- Indeks untuk tabel `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indeks untuk tabel `permissions`
  --
  ALTER TABLE `permissions`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`);
  
  --
  -- Indeks untuk tabel `requests`
  --
  ALTER TABLE `requests`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `restoks`
  --
  ALTER TABLE `restoks`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `roles`
  --
  ALTER TABLE `roles`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`);
  
  --
  -- Indeks untuk tabel `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`);
  
  --
  -- Indeks untuk tabel `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_username_unique` (`username`);
  
  --
  -- AUTO_INCREMENT untuk tabel yang dibuang
  --
  
  --
  -- AUTO_INCREMENT untuk tabel `barangs`
  --
  ALTER TABLE `barangs`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT untuk tabel `barang_keluars`
  --
  ALTER TABLE `barang_keluars`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT untuk tabel `barang_masuks`
  --
  ALTER TABLE `barang_masuks`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT untuk tabel `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
  
  --
  -- AUTO_INCREMENT untuk tabel `permissions`
  --
  ALTER TABLE `permissions`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `requests`
  --
  ALTER TABLE `requests`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT untuk tabel `restoks`
  --
  ALTER TABLE `restoks`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT untuk tabel `roles`
  --
  ALTER TABLE `roles`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT untuk tabel `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
  --
  
  --
  -- Ketidakleluasaan untuk tabel `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;
  
  --
  -- Ketidakleluasaan untuk tabel `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;
  
  --
  -- Ketidakleluasaan untuk tabel `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;
  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 */;
  