-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Waktu pembuatan: 27 Des 2025 pada 02.22
-- Versi server: 8.0.30
-- Versi PHP: 8.3.17

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `pencatatanobat2`
--

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

--
-- Struktur dari tabel `cache`
--

CREATE TABLE `cache` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Struktur dari tabel `cache_locks`
--

CREATE TABLE `cache_locks` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `failed_jobs` (
  `id` bigint 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 `jobs`
--

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

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

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

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

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

--
-- Struktur dari tabel `kategoris`
--

CREATE TABLE `kategoris` (
  `id` bigint UNSIGNED NOT NULL,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `keterangan` varchar(255) 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 untuk tabel `kategoris`
--

INSERT INTO `kategoris` (`id`, `nama`, `keterangan`, `created_at`, `updated_at`) VALUES
(1, 'Analgesik', 'Obat pereda nyeri', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(2, 'Antibiotik', 'Obat anti bakteri', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(3, 'Antipiretik', 'Obat penurun demam', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(4, 'Antihipertensi', 'Obat tekanan darah tinggi', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(5, 'Antidiabetik', 'Obat diabetes', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(6, 'Vitamin dan Suplemen', 'Suplemen kesehatan', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(7, 'Test', NULL, '2025-12-20 09:09:40', '2025-12-20 09:09:40');

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

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

CREATE TABLE `migrations` (
  `id` int UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int 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, '2024_01_01_000003_create_kategoris_table', 1),
(5, '2024_01_01_000004_create_suppliers_table', 1),
(6, '2024_01_01_000005_create_obats_table', 1),
(7, '2024_01_01_000006_create_obat_masuks_table', 1),
(8, '2024_01_01_000007_create_obat_keluars_table', 1),
(9, '2024_01_01_000008_create_satuans_table', 1),
(10, '2024_01_01_000009_add_fields_to_obat_masuks_table', 1),
(11, '2025_12_20_151320_add_nama_supplier_to_obat_masuks_table', 2),
(12, '2025_12_20_152837_update_obat_keluars_use_obat_masuk', 3),
(13, '2025_12_20_154137_add_tujuan_pemakaian_to_obat_keluars_table', 4),
(14, '2025_12_20_155815_make_obat_id_nullable_on_obat_keluars', 5);

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

--
-- Struktur dari tabel `obats`
--

CREATE TABLE `obats` (
  `id` bigint UNSIGNED NOT NULL,
  `kategori_id` bigint UNSIGNED NOT NULL,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `satuan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deskripsi` text COLLATE utf8mb4_unicode_ci,
  `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 `obats`
--

INSERT INTO `obats` (`id`, `kategori_id`, `nama`, `kode`, `satuan`, `deskripsi`, `created_at`, `updated_at`) VALUES
(1, 1, 'Paracetamol 500mg', 'OBT-001', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(2, 1, 'Ibuprofen 400mg', 'OBT-002', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(3, 2, 'Amoxicillin 500mg', 'OBT-003', 'Kapsul', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(4, 2, 'Ciprofloxacin 500mg', 'OBT-004', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(5, 3, 'Aspirin 100mg', 'OBT-005', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(6, 4, 'Amlodipine 5mg', 'OBT-006', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(7, 4, 'Captopril 25mg', 'OBT-007', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(8, 5, 'Metformin 500mg', 'OBT-008', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(9, 6, 'Vitamin C 1000mg', 'OBT-009', 'Tablet', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(10, 6, 'Vitamin D3 1000IU', 'OBT-010', 'Kapsul', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43');

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

--
-- Struktur dari tabel `obat_keluars`
--

CREATE TABLE `obat_keluars` (
  `id` bigint UNSIGNED NOT NULL,
  `obat_masuk_id` bigint UNSIGNED DEFAULT NULL,
  `nama_obat` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `obat_id` bigint UNSIGNED DEFAULT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `kode_batch` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `jumlah` int NOT NULL,
  `tujuan_pemakaian` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tanggal_pengeluaran` date NOT NULL,
  `tanggal_kadaluarsa` date NOT NULL,
  `no_pengeluaran` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_petugas` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_penerima` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tujuan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `catatan` text COLLATE utf8mb4_unicode_ci,
  `status` enum('terkirim','proses','dibatalkan') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'proses',
  `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 `obat_keluars`
--

INSERT INTO `obat_keluars` (`id`, `obat_masuk_id`, `nama_obat`, `obat_id`, `user_id`, `kode_batch`, `jumlah`, `tujuan_pemakaian`, `tanggal_pengeluaran`, `tanggal_kadaluarsa`, `no_pengeluaran`, `nama_petugas`, `nama_penerima`, `tujuan`, `catatan`, `status`, `created_at`, `updated_at`) VALUES
(5, 8, 'Panadol', NULL, 1, 'TEST-01', 10, 'ok', '2025-12-20', '2027-12-27', '22', 'Admin', 'ok', NULL, 'ok', 'proses', '2025-12-20 09:00:16', '2025-12-20 09:00:16'),
(6, 2, 'Ibuprofen 400mg', NULL, 1, 'BCH-2024-002', 20, 'OK', '2025-12-20', '2025-12-27', '2', 'Admin', 'OK', NULL, 'OK', 'proses', '2025-12-20 09:11:56', '2025-12-20 09:11:56');

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

--
-- Struktur dari tabel `obat_masuks`
--

CREATE TABLE `obat_masuks` (
  `id` bigint UNSIGNED NOT NULL,
  `nama_obat` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kategori_id` bigint UNSIGNED DEFAULT NULL,
  `satuan_id` bigint UNSIGNED DEFAULT NULL,
  `nama_supplier` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `obat_id` bigint UNSIGNED DEFAULT NULL,
  `supplier_id` bigint UNSIGNED DEFAULT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `kode_batch` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stok` int NOT NULL,
  `harga_beli` decimal(12,2) NOT NULL,
  `harga_jual` decimal(12,2) NOT NULL,
  `tanggal_penerimaan` date NOT NULL,
  `tanggal_kadaluarsa` date NOT NULL,
  `no_faktur` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `catatan` text COLLATE utf8mb4_unicode_ci,
  `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 `obat_masuks`
--

INSERT INTO `obat_masuks` (`id`, `nama_obat`, `kategori_id`, `satuan_id`, `nama_supplier`, `obat_id`, `supplier_id`, `user_id`, `kode_batch`, `stok`, `harga_beli`, `harga_jual`, `tanggal_penerimaan`, `tanggal_kadaluarsa`, `no_faktur`, `catatan`, `created_at`, `updated_at`) VALUES
(1, 'Paracetamol 500mg', 1, 1, NULL, 1, 1, 1, 'BCH-2024-001', 100, 1500.00, 2500.00, '2025-11-20', '2026-06-20', 'FKT-001', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(2, 'Ibuprofen 400mg', 1, 1, NULL, 2, 1, 1, 'BCH-2024-002', 60, 2000.00, 3500.00, '2025-11-25', '2026-02-03', 'FKT-002', NULL, '2025-12-20 06:50:43', '2025-12-20 09:11:56'),
(3, 'Amoxicillin 500mg', 2, 2, NULL, 3, 2, 1, 'BCH-2024-003', 150, 3000.00, 5000.00, '2025-11-30', '2026-12-20', 'FKT-003', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(4, 'Ciprofloxacin 500mg', 2, 1, NULL, 4, 2, 1, 'BCH-2024-004', 60, 4000.00, 6500.00, '2025-12-05', '2026-01-09', 'FKT-004', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(5, 'Aspirin 100mg', 3, 1, NULL, 5, 3, 1, 'BCH-2024-005', 200, 1000.00, 1800.00, '2025-12-10', '2026-03-05', 'FKT-005', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(6, 'Amlodipine 5mg', 4, 1, NULL, 6, 1, 1, 'BCH-2024-006', 120, 2500.00, 4000.00, '2025-12-15', '2026-08-20', 'FKT-006', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(7, 'Captopril 25mg', 4, 1, NULL, 7, 2, 1, 'BCH-2024-007', 90, 1800.00, 3000.00, '2025-12-17', '2026-01-04', 'FKT-007', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(8, 'Panadol', 2, 2, 'PT G', NULL, NULL, 1, 'TEST-01', 90, 100.00, 200.00, '2025-12-20', '2025-12-23', '0I111', 'OKE', '2025-12-20 08:16:11', '2025-12-20 09:13:51'),
(9, 'Test', 7, 8, 'PT TEST', NULL, NULL, 1, 'TEST-02', 200, 100.00, 200.00, '2025-12-20', '2027-10-12', '0111', 'OK', '2025-12-20 09:10:53', '2025-12-20 09:10:53');

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

--
-- Struktur dari tabel `password_reset_tokens`
--

CREATE TABLE `password_reset_tokens` (
  `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 `satuans`
--

CREATE TABLE `satuans` (
  `id` bigint UNSIGNED NOT NULL,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `keterangan` varchar(255) 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 untuk tabel `satuans`
--

INSERT INTO `satuans` (`id`, `nama`, `keterangan`, `created_at`, `updated_at`) VALUES
(1, 'Tablet', 'Obat dalam bentuk tablet', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(2, 'Kapsul', 'Obat dalam bentuk kapsul', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(3, 'Botol', 'Obat cair dalam botol', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(4, 'Strip', 'Obat dalam kemasan strip', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(5, 'Box', 'Obat dalam kemasan box', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(6, 'Ampul', 'Obat injeksi dalam ampul', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(7, 'Tube', 'Obat salep/krim dalam tube', '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(8, 'Ml', NULL, '2025-12-20 09:09:53', '2025-12-20 09:09:53');

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

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

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int 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
('CWvMXd923eSL9kHHDSY1XxwZybkx8zMz4ubBafEv', 1, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiRXVxQWswVGtrNnFoU1gxemZxWXprUkZCa3lDVVdhMXFRRGZBRjVXeSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6NDA6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9vYmF0LWtlbHVhci81L2VkaXQiO3M6NToicm91dGUiO3M6MTY6Im9iYXQta2VsdWFyLmVkaXQiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjUwOiJsb2dpbl93ZWJfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=', 1766578721),
('XEWcPtymuSTqb64lDcTm8RMIywgdqREpTYsMlHZi', NULL, '127.0.0.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiQzF0YnJNV0lQWXV0UkVVVU1yN1pyOTMxV3ZUSVVDUmV1T2ZzNFAzOCI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mzc6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9mb3Jnb3QtcGFzc3dvcmQiO3M6NToicm91dGUiO3M6MTY6InBhc3N3b3JkLnJlcXVlc3QiO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1766572325);

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

--
-- Struktur dari tabel `suppliers`
--

CREATE TABLE `suppliers` (
  `id` bigint UNSIGNED NOT NULL,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `alamat` text COLLATE utf8mb4_unicode_ci,
  `telepon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) 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 untuk tabel `suppliers`
--

INSERT INTO `suppliers` (`id`, `nama`, `alamat`, `telepon`, `email`, `created_at`, `updated_at`) VALUES
(1, 'PT Kimia Farma', 'Jakarta Pusat', '021-1234567', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(2, 'PT Kalbe Farma', 'Jakarta Timur', '021-7654321', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43'),
(3, 'PT Sanbe Farma', 'Bandung', '022-1234567', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43');

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

--
-- Struktur dari tabel `users`
--

CREATE TABLE `users` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) 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 untuk tabel `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Admin', 'admin@admin.com', NULL, '$2y$12$wQzt9xdtR3BSEgostxRbRuEfRuKgfiNIIyU3RYh13uFPD7KrEMgGi', NULL, '2025-12-20 06:50:43', '2025-12-20 06:50:43');

--
-- Indexes for dumped tables
--

--
-- Indeks untuk tabel `cache`
--
ALTER TABLE `cache`
  ADD PRIMARY KEY (`key`);

--
-- Indeks untuk tabel `cache_locks`
--
ALTER TABLE `cache_locks`
  ADD PRIMARY KEY (`key`);

--
-- 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 `kategoris`
--
ALTER TABLE `kategoris`
  ADD PRIMARY KEY (`id`);

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

--
-- Indeks untuk tabel `obats`
--
ALTER TABLE `obats`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `obats_kode_unique` (`kode`),
  ADD KEY `obats_kategori_id_foreign` (`kategori_id`);

--
-- Indeks untuk tabel `obat_keluars`
--
ALTER TABLE `obat_keluars`
  ADD PRIMARY KEY (`id`),
  ADD KEY `obat_keluars_obat_id_foreign` (`obat_id`),
  ADD KEY `obat_keluars_user_id_foreign` (`user_id`),
  ADD KEY `obat_keluars_obat_masuk_id_foreign` (`obat_masuk_id`);

--
-- Indeks untuk tabel `obat_masuks`
--
ALTER TABLE `obat_masuks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `obat_masuks_obat_id_foreign` (`obat_id`),
  ADD KEY `obat_masuks_supplier_id_foreign` (`supplier_id`),
  ADD KEY `obat_masuks_user_id_foreign` (`user_id`),
  ADD KEY `obat_masuks_kategori_id_foreign` (`kategori_id`),
  ADD KEY `obat_masuks_satuan_id_foreign` (`satuan_id`);

--
-- Indeks untuk tabel `password_reset_tokens`
--
ALTER TABLE `password_reset_tokens`
  ADD PRIMARY KEY (`email`);

--
-- Indeks untuk tabel `satuans`
--
ALTER TABLE `satuans`
  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 `suppliers`
--
ALTER TABLE `suppliers`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- AUTO_INCREMENT untuk tabel yang dibuang
--

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

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

--
-- AUTO_INCREMENT untuk tabel `kategoris`
--
ALTER TABLE `kategoris`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT untuk tabel `obats`
--
ALTER TABLE `obats`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT untuk tabel `obat_keluars`
--
ALTER TABLE `obat_keluars`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT untuk tabel `obat_masuks`
--
ALTER TABLE `obat_masuks`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT untuk tabel `satuans`
--
ALTER TABLE `satuans`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT untuk tabel `suppliers`
--
ALTER TABLE `suppliers`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT untuk tabel `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

--
-- Ketidakleluasaan untuk tabel `obats`
--
ALTER TABLE `obats`
  ADD CONSTRAINT `obats_kategori_id_foreign` FOREIGN KEY (`kategori_id`) REFERENCES `kategoris` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `obat_keluars`
--
ALTER TABLE `obat_keluars`
  ADD CONSTRAINT `obat_keluars_obat_id_foreign` FOREIGN KEY (`obat_id`) REFERENCES `obats` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `obat_keluars_obat_masuk_id_foreign` FOREIGN KEY (`obat_masuk_id`) REFERENCES `obat_masuks` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `obat_keluars_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Ketidakleluasaan untuk tabel `obat_masuks`
--
ALTER TABLE `obat_masuks`
  ADD CONSTRAINT `obat_masuks_kategori_id_foreign` FOREIGN KEY (`kategori_id`) REFERENCES `kategoris` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `obat_masuks_obat_id_foreign` FOREIGN KEY (`obat_id`) REFERENCES `obats` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `obat_masuks_satuan_id_foreign` FOREIGN KEY (`satuan_id`) REFERENCES `satuans` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `obat_masuks_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `obat_masuks_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 */;
