text: -- phpMyAdmin SQL Dump
  -- version 4.9.0.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Dec 10, 2020 at 01:12 AM
  -- Server version: 10.3.16-MariaDB
  -- PHP Version: 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 */;
  
  --
  -- Database: `perpusmadinatul`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `buku`
  --
  
  CREATE TABLE `buku` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `kode_buku` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `judul_buku` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `kategori_id` bigint(20) UNSIGNED NOT NULL,
    `edisi` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `penulis` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `kota_terbit` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `volume` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `deskripsi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `penerbit` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tahun_terbit` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `ISBN` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `jumlah` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `print_qty` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 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 `buku`
  --
  
  INSERT INTO `buku` (`id`, `kode_buku`, `judul_buku`, `kategori_id`, `edisi`, `penulis`, `kota_terbit`, `volume`, `deskripsi`, `penerbit`, `tahun_terbit`, `ISBN`, `jumlah`, `print_qty`, `cover`, `created_at`, `updated_at`) VALUES
  (1, 'A37829298', 'Hujan', 8, NULL, 'Tere Liye', 'Bandung', NULL, NULL, 'Gramedia Pustaka Utama', '2016', 'A37939020928030', '20', NULL, 'hujan.jpg', '2020-12-03 16:43:33', '2020-12-03 16:44:07');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `failed_jobs`
  --
  
  CREATE TABLE `failed_jobs` (
    `id` bigint(20) UNSIGNED 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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `guru`
  --
  
  CREATE TABLE `guru` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `user_id` bigint(20) NOT NULL,
    `NIP` bigint(20) NOT NULL,
    `nama_lengkap` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `alamat` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `gender` enum('P','L') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tempat_lahir` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tanggal_lahir` date DEFAULT NULL,
    `no_telp` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `agama` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `photo` 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 `jenjang_pendidikan`
  --
  
  CREATE TABLE `jenjang_pendidikan` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `jenjang_pendidikan` varchar(50) 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 `jenjang_pendidikan`
  --
  
  INSERT INTO `jenjang_pendidikan` (`id`, `jenjang_pendidikan`, `created_at`, `updated_at`) VALUES
  (1, 'SD Tahfidz', NULL, NULL),
  (2, 'SMP Islam', NULL, NULL),
  (3, 'SMA Tahfidz', NULL, NULL),
  (4, 'P-TB', NULL, NULL),
  (5, 'MA', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kategori_buku`
  --
  
  CREATE TABLE `kategori_buku` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `nama_kategori` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `rak` varchar(100) 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 `kategori_buku`
  --
  
  INSERT INTO `kategori_buku` (`id`, `nama_kategori`, `rak`, `created_at`, `updated_at`) VALUES
  (1, 'Umum', '1', NULL, NULL),
  (2, 'Filsafat dan Psikologi', '2', NULL, NULL),
  (3, 'Agama', '3', NULL, NULL),
  (4, 'Sosial', '4', NULL, NULL),
  (5, 'Bahasa', '5', NULL, NULL),
  (6, 'Sains dan Matematika', '6', NULL, NULL),
  (7, 'Teknologi', '7', NULL, NULL),
  (8, 'Seni dan Rekreasi', '8', NULL, NULL),
  (9, 'Literatur dan Sastra', '9', NULL, NULL),
  (10, 'Sejarah dan Geografi', '10', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for 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;
  
  --
  -- Dumping data for table `migrations`
  --
  
  INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
  (1, '2014_10_12_100000_create_password_resets_table', 1),
  (2, '2019_08_19_000000_create_failed_jobs_table', 1),
  (3, '2020_02_22_005345_create_siswa_table', 1),
  (4, '2020_02_22_034728_create_guru_table', 1),
  (5, '2020_02_22_061055_create_kategori_buku_table', 1),
  (6, '2020_02_22_125444_create_status_table', 1),
  (7, '2020_02_23_060945_create_buku_table', 1),
  (8, '2020_02_23_061312_create_peminjaman_table', 1),
  (9, '2020_02_23_065351_create_genders_table', 1),
  (10, '2020_02_23_070339_create_users_privilege_table', 1),
  (11, '2020_03_13_062137_create_jenjang_pendidikan_table', 1),
  (12, '2020_04_19_075735_create_noted_table', 1),
  (13, '2020_06_16_121222_create_nama_sekolah', 1),
  (14, '2020_10_12_000000_create_users_table', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `nama_sekolah`
  --
  
  CREATE TABLE `nama_sekolah` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `deskripsi` 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 `nama_sekolah`
  --
  
  INSERT INTO `nama_sekolah` (`id`, `deskripsi`, `created_at`, `updated_at`) VALUES
  (1, 'Sistem Informasi Perpustakaan', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `noted`
  --
  
  CREATE TABLE `noted` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `nis` bigint(20) DEFAULT NULL,
    `nip` bigint(20) DEFAULT NULL,
    `nama` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `judul` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `pengarang` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `deskripsi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tanggal_usulan` date NOT NULL,
    `status` varchar(20) 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 `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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `peminjaman`
  --
  
  CREATE TABLE `peminjaman` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `kode_pinjam` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `nis` bigint(20) DEFAULT NULL,
    `nip` bigint(20) DEFAULT NULL,
    `buku_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `status_id` bigint(20) UNSIGNED NOT NULL,
    `tanggal_peminjaman` date NOT NULL,
    `tanggal_harus_kembali` date NOT NULL,
    `keterlambatan` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `denda` decimal(8,2) DEFAULT NULL,
    `kondisi_buku` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `denda_buku` decimal(8,2) 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 `siswa`
  --
  
  CREATE TABLE `siswa` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `NIS` bigint(20) NOT NULL,
    `user_id` bigint(20) NOT NULL,
    `nama_siswa` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `alamat` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `gender` enum('P','L') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `kelas` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tempat_lahir` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tanggal_lahir` date DEFAULT NULL,
    `no_telp` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `agama` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tahun_angkatan` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `photo` 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 `status`
  --
  
  CREATE TABLE `status` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `class` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `status`
  --
  
  INSERT INTO `status` (`id`, `name`, `class`) VALUES
  (1, 'Diperpanjang', 'badge badge-pill badge-primary'),
  (2, 'Dikembalikan', 'badge badge-pill badge-secondary'),
  (3, 'Dipinjam', 'badge badge-pill badge-success');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `staff_id` bigint(20) DEFAULT NULL,
    `nip` bigint(20) DEFAULT NULL,
    `nis` bigint(20) DEFAULT NULL,
    `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `role_id` bigint(20) NOT NULL,
    `nama` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `photo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `alamat` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tempat_lahir` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `tanggal_lahir` date DEFAULT NULL,
    `gender` enum('P','L') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `profesi` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `phone` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `last_login_at` datetime DEFAULT NULL,
    `deleted_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
    `email_verified_at` timestamp NULL DEFAULT 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`, `email`, `staff_id`, `nip`, `nis`, `password`, `role_id`, `nama`, `photo`, `alamat`, `tempat_lahir`, `tanggal_lahir`, `gender`, `profesi`, `phone`, `last_login_at`, `deleted_at`, `email_verified_at`, `remember_token`, `created_at`, `updated_at`) VALUES
  (1, 'admin@gmail.com', 12345678, NULL, NULL, '$2y$10$DMd/YAXgMbMHu3Cke2cy3.pu9sXhWqXurJXf8HuRN5tGrr.V9qllK', 1, 'Superadmin', NULL, 'Yogyakarta', 'Bandung', '1994-10-10', 'L', NULL, '083748374834', NULL, '2020-12-04 00:05:26', NULL, NULL, NULL, '2020-12-03 17:05:26');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users_privilege`
  --
  
  CREATE TABLE `users_privilege` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `privilege_level` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `users_privilege`
  --
  
  INSERT INTO `users_privilege` (`id`, `privilege_level`) VALUES
  (1, 'super administrator'),
  (2, 'admin anggota'),
  (3, 'admin transaksi'),
  (4, 'admin buku'),
  (5, 'siswa'),
  (6, 'guru');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `buku`
  --
  ALTER TABLE `buku`
    ADD PRIMARY KEY (`id`),
    ADD KEY `buku_kategori_id_foreign` (`kategori_id`);
  
  --
  -- Indexes for table `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `guru`
  --
  ALTER TABLE `guru`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `guru_nip_unique` (`NIP`);
  
  --
  -- Indexes for table `jenjang_pendidikan`
  --
  ALTER TABLE `jenjang_pendidikan`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `kategori_buku`
  --
  ALTER TABLE `kategori_buku`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `nama_sekolah`
  --
  ALTER TABLE `nama_sekolah`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `noted`
  --
  ALTER TABLE `noted`
    ADD PRIMARY KEY (`id`),
    ADD KEY `noted_nis_foreign` (`nis`),
    ADD KEY `noted_nip_foreign` (`nip`);
  
  --
  -- Indexes for table `password_resets`
  --
  ALTER TABLE `password_resets`
    ADD KEY `password_resets_email_index` (`email`);
  
  --
  -- Indexes for table `peminjaman`
  --
  ALTER TABLE `peminjaman`
    ADD PRIMARY KEY (`id`),
    ADD KEY `peminjaman_nis_foreign` (`nis`),
    ADD KEY `peminjaman_nip_foreign` (`nip`),
    ADD KEY `peminjaman_status_id_foreign` (`status_id`);
  
  --
  -- Indexes for table `siswa`
  --
  ALTER TABLE `siswa`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `siswa_nis_unique` (`NIS`);
  
  --
  -- Indexes for table `status`
  --
  ALTER TABLE `status`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`);
  
  --
  -- Indexes for table `users_privilege`
  --
  ALTER TABLE `users_privilege`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `buku`
  --
  ALTER TABLE `buku`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `failed_jobs`
  --
  ALTER TABLE `failed_jobs`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `guru`
  --
  ALTER TABLE `guru`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `jenjang_pendidikan`
  --
  ALTER TABLE `jenjang_pendidikan`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  
  --
  -- AUTO_INCREMENT for table `kategori_buku`
  --
  ALTER TABLE `kategori_buku`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  
  --
  -- AUTO_INCREMENT for table `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
  
  --
  -- AUTO_INCREMENT for table `nama_sekolah`
  --
  ALTER TABLE `nama_sekolah`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `noted`
  --
  ALTER TABLE `noted`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `peminjaman`
  --
  ALTER TABLE `peminjaman`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `siswa`
  --
  ALTER TABLE `siswa`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `status`
  --
  ALTER TABLE `status`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `users_privilege`
  --
  ALTER TABLE `users_privilege`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `buku`
  --
  ALTER TABLE `buku`
    ADD CONSTRAINT `buku_kategori_id_foreign` FOREIGN KEY (`kategori_id`) REFERENCES `kategori_buku` (`id`);
  
  --
  -- Constraints for table `noted`
  --
  ALTER TABLE `noted`
    ADD CONSTRAINT `noted_nip_foreign` FOREIGN KEY (`nip`) REFERENCES `guru` (`NIP`) ON DELETE CASCADE,
    ADD CONSTRAINT `noted_nis_foreign` FOREIGN KEY (`nis`) REFERENCES `siswa` (`NIS`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `peminjaman`
  --
  ALTER TABLE `peminjaman`
    ADD CONSTRAINT `peminjaman_nip_foreign` FOREIGN KEY (`nip`) REFERENCES `guru` (`NIP`) ON DELETE CASCADE,
    ADD CONSTRAINT `peminjaman_nis_foreign` FOREIGN KEY (`nis`) REFERENCES `siswa` (`NIS`) ON DELETE CASCADE,
    ADD CONSTRAINT `peminjaman_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `status` (`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 */;
  