text: -- phpMyAdmin SQL Dump
  -- version 4.8.3
  -- https://www.phpmyadmin.net/
  --
  -- Host: localhost
  -- Generation Time: Apr 02, 2019 at 09:17 AM
  -- Server version: 10.1.36-MariaDB
  -- PHP Version: 7.2.10
  
  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: `e-learning`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `absen`
  --
  
  CREATE TABLE `absen` (
    `id` int(10) UNSIGNED NOT NULL,
    `user_id` int(11) NOT NULL,
    `date` date NOT NULL,
    `time_in` time NOT NULL,
    `time_out` time DEFAULT NULL,
    `note` 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 `artikel`
  --
  
  CREATE TABLE `artikel` (
    `id` int(10) UNSIGNED NOT NULL,
    `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `foto` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `id_kategori` int(10) UNSIGNED NOT NULL,
    `ket` 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 `artikel`
  --
  
  INSERT INTO `artikel` (`id`, `title`, `slug`, `foto`, `content`, `id_kategori`, `ket`, `created_at`, `updated_at`) VALUES
  (1, 'hawvdcd', 'hawvdcd', 'Screenshot from 2018-10-25 10-55-25.png', '<p>r3r34t43t34xxxxx</p>', 1, 'Unpublish', '2019-04-02 07:13:49', '2019-04-02 07:13:49');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `guru`
  --
  
  CREATE TABLE `guru` (
    `id` int(10) UNSIGNED NOT NULL,
    `nipd` int(11) NOT NULL,
    `nama` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `foto` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `mapel` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `alamat` 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;
  
  --
  -- Dumping data for table `guru`
  --
  
  INSERT INTO `guru` (`id`, `nipd`, `nama`, `foto`, `mapel`, `alamat`, `created_at`, `updated_at`) VALUES
  (1, 2897398, 'Asep Aming', 'Messages-512.png', 'PAI', 'Kp indomaret', '2019-04-02 07:11:49', '2019-04-02 07:11:49');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kategori`
  --
  
  CREATE TABLE `kategori` (
    `id` int(10) UNSIGNED NOT NULL,
    `nama_kategori` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `slug` 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 `kategori`
  --
  
  INSERT INTO `kategori` (`id`, `nama_kategori`, `slug`, `created_at`, `updated_at`) VALUES
  (1, 'Kuliner', 'kuliner', '2019-04-02 07:13:19', '2019-04-02 07:13:19');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kelas`
  --
  
  CREATE TABLE `kelas` (
    `id` int(10) UNSIGNED NOT NULL,
    `nama` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `wali_kelas` 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;
  
  --
  -- Dumping data for table `kelas`
  --
  
  INSERT INTO `kelas` (`id`, `nama`, `wali_kelas`, `created_at`, `updated_at`) VALUES
  (1, 'Xii Rpl 1', 1, '2019-04-02 07:12:07', '2019-04-02 07:12:07');
  
  -- --------------------------------------------------------
  
  --
  -- 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, '2018_05_31_032402_create_kategori_table', 1),
  (2, '2018_11_12_032523_create-guru-table', 1),
  (3, '2018_11_14_063627_create-kelas-table', 1),
  (4, '2018_11_22_031102_create-artikel-table', 1),
  (5, '2018_11_22_032509_create-siswa-table', 1),
  (6, '2018_11_28_010025_create-tugas-table', 1),
  (7, '2018_12_11_000000_create_users_table', 1),
  (8, '2018_12_12_100000_create_password_resets_table', 1),
  (9, '2018_12_12_143706_CreateTableAbsen', 1),
  (10, '2018_12_13_135819_create-review-table', 1),
  (11, '2019_01_11_090516_create-tugas_siswa-table', 1),
  (12, '2019_01_27_170355_create-tugas_file-table', 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 `review`
  --
  
  CREATE TABLE `review` (
    `id` int(10) UNSIGNED NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `foto` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `review` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `ket` 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 `siswa`
  --
  
  CREATE TABLE `siswa` (
    `id` int(10) UNSIGNED NOT NULL,
    `nis` int(11) NOT NULL,
    `nama` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `foto` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `id_kelas` int(10) UNSIGNED NOT NULL,
    `alamat` 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;
  
  --
  -- Dumping data for table `siswa`
  --
  
  INSERT INTO `siswa` (`id`, `nis`, `nama`, `foto`, `id_kelas`, `alamat`, `created_at`, `updated_at`) VALUES
  (1, 273725332, 'Rizky Bagus', 'Messages-512.png', 1, 'Kp sukaluyu', '2019-04-02 07:12:39', '2019-04-02 07:12:39');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tugas`
  --
  
  CREATE TABLE `tugas` (
    `id` int(10) UNSIGNED NOT NULL,
    `pengirim` int(10) UNSIGNED NOT NULL,
    `file` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `KKM` int(11) DEFAULT NULL,
    `nilai` int(11) DEFAULT NULL,
    `ket` 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 `tugas`
  --
  
  INSERT INTO `tugas` (`id`, `pengirim`, `file`, `KKM`, `nilai`, `ket`, `created_at`, `updated_at`) VALUES
  (1, 1, 'XII_UAS.docx', 77, NULL, 'Belum Dikerjakan', '2019-04-02 07:15:40', '2019-04-02 07:15:40');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tugas_file`
  --
  
  CREATE TABLE `tugas_file` (
    `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;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tugas_siswa`
  --
  
  CREATE TABLE `tugas_siswa` (
    `id` int(10) UNSIGNED NOT NULL,
    `id_tugas` int(10) UNSIGNED NOT NULL,
    `id_siswa` 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;
  
  --
  -- Dumping data for table `tugas_siswa`
  --
  
  INSERT INTO `tugas_siswa` (`id`, `id_tugas`, `id_siswa`, `created_at`, `updated_at`) VALUES
  (1, 1, 1, NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` int(10) UNSIGNED NOT NULL,
    `id_siswa` int(10) UNSIGNED DEFAULT NULL,
    `id_guru` int(10) UNSIGNED DEFAULT NULL,
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `role` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `email_verified_at` timestamp NULL DEFAULT NULL,
    `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `status` 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`, `id_siswa`, `id_guru`, `email`, `role`, `email_verified_at`, `password`, `status`, `remember_token`, `created_at`, `updated_at`) VALUES
  (1, NULL, NULL, 'admin@gmail.com', 'Admin', NULL, '$2y$10$cJiyVcxago5lIyRJndXd0eG49RiGL49A3gGOri8BzYMKeYUi3Gg9S', 'Aktif', NULL, '2019-04-02 06:52:46', '2019-04-02 06:52:46');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `absen`
  --
  ALTER TABLE `absen`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `artikel`
  --
  ALTER TABLE `artikel`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `artikel_title_unique` (`title`),
    ADD KEY `artikel_id_kategori_foreign` (`id_kategori`);
  
  --
  -- Indexes for table `guru`
  --
  ALTER TABLE `guru`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `kategori`
  --
  ALTER TABLE `kategori`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `kategori_nama_kategori_unique` (`nama_kategori`);
  
  --
  -- Indexes for table `kelas`
  --
  ALTER TABLE `kelas`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `kelas_nama_unique` (`nama`),
    ADD UNIQUE KEY `kelas_wali_kelas_unique` (`wali_kelas`);
  
  --
  -- 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 `review`
  --
  ALTER TABLE `review`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `review_name_unique` (`name`);
  
  --
  -- Indexes for table `siswa`
  --
  ALTER TABLE `siswa`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `siswa_nis_unique` (`nis`),
    ADD UNIQUE KEY `siswa_nama_unique` (`nama`),
    ADD KEY `siswa_id_kelas_foreign` (`id_kelas`);
  
  --
  -- Indexes for table `tugas`
  --
  ALTER TABLE `tugas`
    ADD PRIMARY KEY (`id`),
    ADD KEY `tugas_pengirim_foreign` (`pengirim`);
  
  --
  -- Indexes for table `tugas_file`
  --
  ALTER TABLE `tugas_file`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `tugas_siswa`
  --
  ALTER TABLE `tugas_siswa`
    ADD PRIMARY KEY (`id`),
    ADD KEY `tugas_siswa_id_tugas_foreign` (`id_tugas`),
    ADD KEY `tugas_siswa_id_siswa_foreign` (`id_siswa`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `users_email_unique` (`email`),
    ADD UNIQUE KEY `users_id_siswa_unique` (`id_siswa`),
    ADD UNIQUE KEY `users_id_guru_unique` (`id_guru`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `absen`
  --
  ALTER TABLE `absen`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `artikel`
  --
  ALTER TABLE `artikel`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `guru`
  --
  ALTER TABLE `guru`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `kategori`
  --
  ALTER TABLE `kategori`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `kelas`
  --
  ALTER TABLE `kelas`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  
  --
  -- AUTO_INCREMENT for table `review`
  --
  ALTER TABLE `review`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `siswa`
  --
  ALTER TABLE `siswa`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `tugas`
  --
  ALTER TABLE `tugas`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `tugas_file`
  --
  ALTER TABLE `tugas_file`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tugas_siswa`
  --
  ALTER TABLE `tugas_siswa`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- 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 `artikel`
  --
  ALTER TABLE `artikel`
    ADD CONSTRAINT `artikel_id_kategori_foreign` FOREIGN KEY (`id_kategori`) REFERENCES `kategori` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `kelas`
  --
  ALTER TABLE `kelas`
    ADD CONSTRAINT `kelas_wali_kelas_foreign` FOREIGN KEY (`wali_kelas`) REFERENCES `guru` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `siswa`
  --
  ALTER TABLE `siswa`
    ADD CONSTRAINT `siswa_id_kelas_foreign` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `tugas`
  --
  ALTER TABLE `tugas`
    ADD CONSTRAINT `tugas_pengirim_foreign` FOREIGN KEY (`pengirim`) REFERENCES `guru` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `tugas_siswa`
  --
  ALTER TABLE `tugas_siswa`
    ADD CONSTRAINT `tugas_siswa_id_siswa_foreign` FOREIGN KEY (`id_siswa`) REFERENCES `siswa` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `tugas_siswa_id_tugas_foreign` FOREIGN KEY (`id_tugas`) REFERENCES `tugas` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `users`
  --
  ALTER TABLE `users`
    ADD CONSTRAINT `users_id_guru_foreign` FOREIGN KEY (`id_guru`) REFERENCES `guru` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `users_id_siswa_foreign` FOREIGN KEY (`id_siswa`) REFERENCES `siswa` (`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 */;
  