-- https://www.phpmyadmin.net/
--
-- Waktu pembuatan: 09 Feb 2026 pada 04.41
-- Versi server: 10.4.28-MariaDB
-- Versi PHP: 8.2.4

START TRANSACTION;



--
-- Database: `maintanance-lab`
--

-- --------------------------------------------------------

--
-- Struktur dari tabel `barangs`
--

CREATE TABLE `barangs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `id_lab` bigint(20) UNSIGNED DEFAULT NULL,
  `nama_barang` varchar(255) NOT NULL,
  `merk_tipe` varchar(255) DEFAULT NULL,
  `kode_bmn` varchar(255) NOT NULL,
  `tahun_perolehan` int(11) DEFAULT NULL,
  `kategori` varchar(255) DEFAULT NULL,
  `status_kondisi` varchar(255) NOT NULL DEFAULT 'Normal',
  `klasifikasi_fungsi` varchar(255) NOT NULL DEFAULT 'Pendidikan',
  `foto_identifikasi` varchar(255) DEFAULT NULL,
  `next_calibration` date 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 untuk tabel `barangs`
--

INSERT INTO `barangs` (`id`, `id_lab`, `nama_barang`, `merk_tipe`, `kode_bmn`, `tahun_perolehan`, `kategori`, `status_kondisi`, `klasifikasi_fungsi`, `foto_identifikasi`, `next_calibration`, `created_at`, `updated_at`) VALUES
(1, 1, 'Spektrofotometer UV-Vis', 'Shimadzu UV-1900i', 'BMN-TPK-001', 2022, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(2, 1, 'pH Meter Digital', 'Hanna Instruments HI98107', 'BMN-TPK-002', 2023, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(3, 2, 'Instalasi Pengolahan Air Limbah (Mini)', 'Custom Tech 2021', 'BMN-TPK-003', 2021, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(4, 3, 'Inkubator Mikrobiologi', 'Memmert IN55', 'BMN-TPK-004', 2020, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(5, 4, 'Drum Tanning Kayu Lapis', 'Local Machine V2', 'BMN-TPK-005', 2019, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(6, 5, 'Mesin Spray Finishing Kulit', 'Bergi Superflat', 'BMN-TPK-006', 2021, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(7, 6, 'PC Workstation Desain', 'Dell Precision 3660', 'BMN-TPPK-001', 2023, 'Elektronik', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(8, 7, 'Mesin Seset Kulit (Skiving)', 'Fortuna V50', 'BMN-TPPK-002', 2022, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(9, 8, 'Mesin Jahit Upper Sepatu', 'Juki 1541-7', 'BMN-TPPK-003', 2021, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(10, 10, 'Manekin Full Body', 'Premium Fiberglass', 'BMN-TPPK-004', 2023, 'Furnitur', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(11, 11, 'Mesin Jahit High Speed', 'Singer 191D', 'BMN-TPPK-005', 2022, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(12, 12, 'Mesin Embossing Kulit', 'Hydraulic Press HP-20', 'BMN-TPPK-006', 2021, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(13, 13, 'Viskometer Brookfield', 'LVDV-E', 'BMN-TPKP-001', 2022, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(14, 14, 'Server Lab Komputasi', 'HP ProLiant DL380', 'BMN-TPKP-002', 2020, 'Elektronik', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(15, 15, 'Universal Testing Machine (UTM)', 'Instron 3400', 'BMN-TPKP-003', 2023, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(16, 16, 'Two Roll Mill Karet', 'Mixing Mill 6 Inch', 'BMN-TPKP-004', 2021, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25'),
(17, 17, 'Mesin Injection Molding Plastik', 'Haitian MA1200', 'BMN-TPKP-005', 2022, 'Alat Laboratorium', 'Normal', 'Pendidikan', NULL, NULL, '2026-01-20 19:02:25', '2026-01-20 19:02:25');

-- --------------------------------------------------------

--
-- Struktur dari tabel `equipment`
--

CREATE TABLE `equipment` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `id_lab` bigint(20) UNSIGNED DEFAULT NULL,
  `id_kategori` bigint(20) UNSIGNED DEFAULT NULL,
  `lab_id` bigint(20) UNSIGNED NOT NULL,
  `kategori_id` bigint(20) UNSIGNED NOT NULL,
  `klasifikasi_fungsi` enum('Pendidikan','Non-Pendidikan') NOT NULL DEFAULT 'Pendidikan',
  `kode_aset` varchar(255) DEFAULT NULL COMMENT 'Nomor inventaris negara (BMN)',
  `nama_alat` varchar(255) NOT NULL,
  `merk` varchar(255) DEFAULT NULL,
  `tahun_perolehan` year(4) DEFAULT NULL,
  `status_kondisi` enum('Normal','Rusak Ringan','Rusak Berat','Perbaikan') NOT NULL DEFAULT 'Normal',
  `foto_alat` varchar(255) DEFAULT NULL COMMENT 'Foto alat untuk identifikasi visual',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `last_calibration` date DEFAULT NULL,
  `next_calibration` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `queue` varchar(255) NOT NULL,
  `payload` longtext NOT NULL,
  `attempts` tinyint(3) UNSIGNED NOT NULL,
  `reserved_at` int(10) UNSIGNED DEFAULT NULL,
  `available_at` int(10) UNSIGNED NOT NULL,
  `created_at` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_jobs` int(11) NOT NULL,
  `pending_jobs` int(11) NOT NULL,
  `failed_jobs` int(11) NOT NULL,
  `failed_job_ids` longtext NOT NULL,
  `options` mediumtext DEFAULT NULL,
  `cancelled_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `finished_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Struktur dari tabel `laboratoriums`
--

CREATE TABLE `laboratoriums` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `prodi_id` bigint(20) UNSIGNED NOT NULL,
  `nama_lab` varchar(255) 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 `laboratoriums`
--

INSERT INTO `laboratoriums` (`id`, `prodi_id`, `nama_lab`, `created_at`, `updated_at`) VALUES
(1, 1, 'Lab Kimia Terapan', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(2, 1, 'Lab Limbah dan UPAL', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(3, 1, 'Lab Mikrobiologi dan Teknologi Enzim', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(4, 1, 'Workshop Beam House dan Tanning', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(5, 1, 'Workshop Pasca Tanning dan Finishing', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(6, 2, 'Lab Pengembangan Desain', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(7, 2, 'Workshop Acuan', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(8, 2, 'Workshop Alas Kaki (Upper Shoes)', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(9, 2, 'Workshop Alas Kaki (Bottom Shoes)', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(10, 2, 'Workshop Busana', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(11, 2, 'Workshop Jahit', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(12, 2, 'Workshop Produk Kulit', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(13, 3, 'Lab Instrumentasi dan Teknik Polimer', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(14, 3, 'Lab Komputasi dan Optimisasi Sistem Industri', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(15, 3, 'Workshop Pengujian', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(16, 3, 'Workshop Karet ', '2026-01-20 19:02:24', '2026-01-20 19:02:24'),
(17, 3, 'Workshop Plastik', '2026-01-20 19:02:24', '2026-01-20 19:02:24');

-- --------------------------------------------------------

--
-- Struktur dari tabel `maintenance_requests`
--

CREATE TABLE `maintenance_requests` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `barang_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `id_lab` bigint(20) UNSIGNED DEFAULT NULL,
  `issue_description` text NOT NULL,
  `foto_kerusakan` varchar(255) DEFAULT NULL,
  `urgency` enum('Low','Medium','High') NOT NULL DEFAULT 'Medium',
  `damage_level` enum('Ringan','Sedang','Berat') NOT NULL DEFAULT 'Ringan',
  `request_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `status` varchar(255) NOT NULL DEFAULT 'pending_kaprodi',
  `technical_recommendation` text DEFAULT NULL,
  `repair_type` enum('Internal','External') DEFAULT NULL,
  `estimated_cost` decimal(15,2) DEFAULT NULL,
  `quotation_file` varchar(255) DEFAULT NULL,
  `rejection_note` text 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 untuk tabel `maintenance_requests`
--

INSERT INTO `maintenance_requests` (`id`, `barang_id`, `user_id`, `id_lab`, `issue_description`, `foto_kerusakan`, `urgency`, `damage_level`, `request_date`, `status`, `technical_recommendation`, `repair_type`, `estimated_cost`, `quotation_file`, `rejection_note`, `created_at`, `updated_at`) VALUES
(1, 1, 8, 1, 'Terjatuh dan tidak berfungsi', 'assets/maintenance/issues/uSrw5hldIeql9YzytFe4lCTygUn7bgxkU9QeZLxt.jpg', 'Medium', 'Sedang', '2026-01-20 19:03:40', 'closed', 'Membeli beberapa sparepart untuk mengganti bagian yang rusak', 'Internal', 250000.00, NULL, NULL, '2026-01-20 19:03:40', '2026-01-21 01:17:01');

-- --------------------------------------------------------

--
-- Struktur dari tabel `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) 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, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2025_12_23_012647_create_equipment_table', 1),
(5, '2025_12_23_012647_create_maintenance_requests_table', 1),
(6, '2026_01_02_071141_create_prodis_table', 1),
(7, '2026_01_02_071146_create_laboratoriums_table', 1),
(8, '2026_01_02_071147_create_kategoris_table', 1),
(9, '2026_01_02_071359_update_equipments_table', 1),
(10, '2026_01_03_103545_add_id_kategori_to_equipment_table', 1),
(11, '2026_01_03_105031_add_foto_kerusakan_to_maintenance_requests_table', 1),
(12, '2026_01_03_135200_add_default_to_prodi_id_in_users_table', 1),
(13, '2026_01_04_082330_add_id_lab_to_maintenance_requests_table', 1),
(14, '2026_01_04_122537_add_calibration_columns_to_equipment_table', 1),
(15, '2026_01_15_023004_create_units_table', 1),
(16, '2026_01_15_034252_add_prodi_id_and_lab_id_to_users_table', 1),
(17, '2026_01_19_081355_add_barang_id_to_maintenances_table', 1),
(18, '2026_01_19_082019_create_barangs_table', 1),
(19, '2026_01_19_084119_update_barangs_table_structure', 1),
(20, '2026_01_21_014550_remove_equipment_id_from_maintenance_requests', 1);

-- --------------------------------------------------------

--
-- Struktur dari tabel `prodis`
--

CREATE TABLE `prodis` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama_prodi` varchar(255) 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 `prodis`
--

INSERT INTO `prodis` (`id`, `nama_prodi`, `created_at`, `updated_at`) VALUES
(1, 'Teknologi Pengolahan Kulit (TPK)', NULL, NULL),
(2, 'Teknologi Pengolahan Produk Kulit (TPPK)', NULL, NULL),
(3, 'Teknologi Pengolahan Karet dan Plastik (TPKP)', NULL, NULL);

-- --------------------------------------------------------

--
-- Struktur dari tabel `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` longtext NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `sessions`
--

INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`) VALUES
('a4wW1IfFfJYvNwOVtdpxkEpHCq1tsGZDq2jBxrvp', 3, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiSmF1QWY5THhoVXNBdmN4cEhuSmlNT2RGV3p1RUhGVHBzZkZvdENjeSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDc6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hZG1pbi9wdWRpcjEvdG90YWwtYXNzZXRzIjtzOjU6InJvdXRlIjtzOjE5OiJwdWRpcjEudG90YWxfYXNzZXRzIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6Mzt9', 1770351291),
('NxIRb4YmI16nEAUo1n9o6pWRniRR4Y1qbcsFIMTz', 3, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiYzVKUGUyajBoaWNZWDB0RGN3TFNGU3ZLa1NNcWRGMXNvNFBiNkZoZiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6ODE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9hZG1pbi9wdWRpcjEvdG90YWwtYXNzZXRzP3Byb2RpX2lkPSZzZWFyY2g9JnN0YXR1c19rb25kaXNpPSI7czo1OiJyb3V0ZSI7czoxOToicHVkaXIxLnRvdGFsX2Fzc2V0cyI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjM7fQ==', 1770178466),
('RflhuMZGDIfynD9bPXRrUUPzIQvZHXAM6yjYUlth', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiekRwOHFoZ0ZETWJwOUFGb01HUktmbm5ad0RHaXlxdDFEYXhzekM5QiI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJuZXciO2E6MDp7fXM6Mzoib2xkIjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMCI7czo1OiJyb3V0ZSI7czo1OiJsb2dpbiI7fX0=', 1770608298);

-- --------------------------------------------------------

--
-- Struktur dari tabel `tbl_kategori`
--

CREATE TABLE `tbl_kategori` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama_kategori` varchar(255) 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 `units`
--

CREATE TABLE `units` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama_lab` varchar(255) NOT NULL,
  `prodi` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indeks untuk tabel `barangs`
--
ALTER TABLE `barangs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `barangs_kode_bmn_unique` (`kode_bmn`),
  ADD KEY `barangs_id_lab_foreign` (`id_lab`);

--
-- Indeks untuk tabel `equipment`
--
ALTER TABLE `equipment`
  ADD PRIMARY KEY (`id`),
  ADD KEY `equipment_lab_id_foreign` (`lab_id`),
  ADD KEY `equipment_kategori_id_foreign` (`kategori_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 `jobs`
--
ALTER TABLE `jobs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jobs_queue_index` (`queue`);

--
-- Indeks untuk tabel `job_batches`
--
ALTER TABLE `job_batches`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `laboratoriums`
--
ALTER TABLE `laboratoriums`
  ADD PRIMARY KEY (`id`),
  ADD KEY `laboratoriums_prodi_id_foreign` (`prodi_id`);

--
-- Indeks untuk tabel `maintenance_requests`
--
ALTER TABLE `maintenance_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `maintenance_requests_user_id_foreign` (`user_id`);

--
-- Indeks untuk tabel `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `prodis`
--
ALTER TABLE `prodis`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sessions_user_id_index` (`user_id`),
  ADD KEY `sessions_last_activity_index` (`last_activity`);

--
-- Indeks untuk tabel `tbl_kategori`
--
ALTER TABLE `tbl_kategori`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`);

--
-- 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=18;

--
-- AUTO_INCREMENT untuk tabel `equipment`
--
ALTER TABLE `equipment`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT untuk tabel `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT untuk tabel `jobs`
--
ALTER TABLE `jobs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT untuk tabel `laboratoriums`
--
ALTER TABLE `laboratoriums`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT untuk tabel `maintenance_requests`
--
ALTER TABLE `maintenance_requests`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT untuk tabel `prodis`
--
ALTER TABLE `prodis`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT untuk tabel `tbl_kategori`
--
ALTER TABLE `tbl_kategori`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT untuk tabel `units`
--
ALTER TABLE `units`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--

--
-- Ketidakleluasaan untuk tabel `barangs`
--
ALTER TABLE `barangs`
  ADD CONSTRAINT `barangs_id_lab_foreign` FOREIGN KEY (`id_lab`) REFERENCES `laboratoriums` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `equipment`
--
ALTER TABLE `equipment`
  ADD CONSTRAINT `equipment_kategori_id_foreign` FOREIGN KEY (`kategori_id`) REFERENCES `tbl_kategori` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `equipment_lab_id_foreign` FOREIGN KEY (`lab_id`) REFERENCES `laboratoriums` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `laboratoriums`
--
ALTER TABLE `laboratoriums`
  ADD CONSTRAINT `laboratoriums_prodi_id_foreign` FOREIGN KEY (`prodi_id`) REFERENCES `prodis` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `maintenance_requests`
--
ALTER TABLE `maintenance_requests`
  ADD CONSTRAINT `maintenance_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

