-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Waktu pembuatan: 24 Feb 2026 pada 11.00
-- Versi server: 10.6.25-MariaDB
-- Versi PHP: 8.4.16

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: `medorymy_main`
--

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

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

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

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

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

CREATE TABLE `cache_locks` (
  `key` varchar(255) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `expiration` int(11) NOT 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 `kategoris`
--

CREATE TABLE `kategoris` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama` varchar(255) NOT NULL,
  `keterangan` varchar(255) 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-24 04:52:26', '2025-12-24 04:52:26'),
(2, 'Antibiotik', 'Obat anti bakteri', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(3, 'Antipiretik', 'Obat penurun demam', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(4, 'Antihipertensi', 'Obat tekanan darah tinggi', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(5, 'Antidiabetik', 'Obat diabetes', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(6, 'Vitamin dan Suplemen', 'Suplemen kesehatan', '2025-12-24 04:52:26', '2025-12-24 04:52:26');

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

--
-- 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, '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', 1),
(12, '2025_12_20_152837_update_obat_keluars_use_obat_masuk', 1),
(13, '2025_12_20_154137_add_tujuan_pemakaian_to_obat_keluars_table', 1),
(14, '2025_12_20_155815_make_obat_id_nullable_on_obat_keluars', 1),
(15, '2026_02_01_000001_add_role_to_users_table', 2),
(16, '2026_02_01_000002_create_reseps_table', 3),
(17, '2026_02_01_000003_create_resep_items_table', 4),
(18, '2026_02_08_000001_update_reseps_table', 5),
(19, '2026_02_08_000002_update_obat_masuks_table', 6),
(20, '2026_02_08_000003_update_obat_keluars_table', 7),
(21, '2026_02_10_104449_make_harga_beli_nullable_in_obat_masuks_table', 8),
(22, '2026_02_21_000004_add_profile_fields_to_users_table', 9);

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

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

CREATE TABLE `obats` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `kategori_id` bigint(20) UNSIGNED NOT NULL,
  `nama` varchar(255) NOT NULL,
  `kode` varchar(255) NOT NULL,
  `satuan` varchar(255) NOT NULL,
  `deskripsi` 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 `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-24 04:52:26', '2025-12-24 04:52:26'),
(2, 1, 'Ibuprofen 400mg', 'OBT-002', 'Tablet', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(3, 2, 'Amoxicillin 500mg', 'OBT-003', 'Kapsul', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(4, 2, 'Ciprofloxacin 500mg', 'OBT-004', 'Tablet', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(5, 3, 'Aspirin 100mg', 'OBT-005', 'Tablet', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(6, 4, 'Amlodipine 5mg', 'OBT-006', 'Tablet', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(7, 4, 'Captopril 25mg', 'OBT-007', 'Tablet', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(8, 5, 'Metformin 500mg', 'OBT-008', 'Tablet', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(9, 6, 'Vitamin C 1000mg', 'OBT-009', 'Tablet', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(10, 6, 'Vitamin D3 1000IU', 'OBT-010', 'Kapsul', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26');

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

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

CREATE TABLE `obat_keluars` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `obat_masuk_id` bigint(20) UNSIGNED DEFAULT NULL,
  `nama_obat` varchar(255) DEFAULT NULL,
  `obat_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `kode_batch` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `jumlah` int(11) NOT NULL,
  `harga` decimal(15,2) DEFAULT NULL,
  `harga_total` decimal(15,2) DEFAULT NULL,
  `tujuan_pemakaian` varchar(255) DEFAULT NULL,
  `sumber_dana` varchar(255) DEFAULT NULL,
  `tanggal_pengeluaran` date NOT NULL,
  `tanggal_kadaluarsa` date NOT NULL,
  `no_pengeluaran` varchar(255) DEFAULT NULL,
  `nama_petugas` varchar(255) NOT NULL,
  `nama_penerima` varchar(255) NOT NULL,
  `tujuan` varchar(255) DEFAULT NULL,
  `catatan` text DEFAULT NULL,
  `status` enum('proses','selesai','dibatalkan') 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`, `barcode`, `jumlah`, `harga`, `harga_total`, `tujuan_pemakaian`, `sumber_dana`, `tanggal_pengeluaran`, `tanggal_kadaluarsa`, `no_pengeluaran`, `nama_petugas`, `nama_penerima`, `tujuan`, `catatan`, `status`, `created_at`, `updated_at`) VALUES
(1, NULL, NULL, 1, 1, 'BCH-2024-001', NULL, 20, NULL, NULL, NULL, NULL, '2025-12-19', '2026-06-24', 'OUT-001', 'Admin', 'Apotek Sehat', 'Distribusi', NULL, 'selesai', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(2, NULL, NULL, 2, 1, 'BCH-2024-002', NULL, 15, NULL, NULL, NULL, NULL, '2025-12-20', '2026-02-07', 'OUT-002', 'Admin', 'Puskesmas Maju', 'Distribusi', NULL, 'selesai', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(3, NULL, NULL, 3, 1, 'BCH-2024-003', NULL, 30, NULL, NULL, NULL, NULL, '2025-12-21', '2026-12-24', 'OUT-003', 'Admin', 'RS Harapan', 'Distribusi', NULL, 'proses', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(4, NULL, NULL, 5, 1, 'BCH-2024-005', NULL, 50, NULL, NULL, NULL, NULL, '2025-12-22', '2026-03-09', 'OUT-004', 'Admin', 'Klinik Pratama', 'Distribusi', NULL, 'selesai', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(5, 7, 'Captopril 25mg', NULL, 1, 'BCH-2024-007', NULL, 2, NULL, NULL, 'RAWAT INAP', NULL, '2025-12-24', '2025-12-31', NULL, 'JARWO', 'siti', NULL, NULL, 'proses', '2025-12-24 05:00:17', '2025-12-24 05:00:17'),
(6, 3, 'Amoxicillin 500mg', NULL, 2, 'BCH-2024-003', NULL, 1, NULL, NULL, 'Resep: RSP-20260202-0001 - sakina', NULL, '2026-02-02', '2026-12-24', 'RSP-20260202-0001', 'Dokter', 'sakina', NULL, 'Otomatis dari resep RSP-20260202-0001', 'selesai', '2026-02-01 20:14:12', '2026-02-10 07:15:45'),
(7, 2, 'Ibuprofen 400mg', NULL, 2, 'BCH-2024-002', NULL, 1, NULL, NULL, 'Resep: RSP-20260203-0001 - elsa', NULL, '2026-02-03', '2026-02-07', 'RSP-20260203-0001', 'Dokter', 'elsa', NULL, 'Otomatis dari resep RSP-20260203-0001', 'selesai', '2026-02-02 20:12:25', '2026-02-02 20:12:25'),
(8, 6, 'Amlodipine 5mg', NULL, 2, 'BCH-2024-006', NULL, 1, NULL, NULL, 'Resep: RSP-20260210-0001 - a', NULL, '2026-02-10', '2026-08-24', 'RSP-20260210-0001', 'Dokter', 'a', NULL, 'Otomatis dari resep RSP-20260210-0001', 'selesai', '2026-02-10 07:20:40', '2026-02-10 08:00:24'),
(9, 6, 'Amlodipine 5mg', NULL, 2, 'BCH-2024-006', NULL, 1, NULL, NULL, 'Resep: RSP-20260215-0001 - Zeril', NULL, '2026-02-15', '2026-08-24', 'RSP-20260215-0001', 'Dokter', 'Zeril', NULL, 'Otomatis dari resep RSP-20260215-0001', 'selesai', '2026-02-15 08:11:11', '2026-02-15 08:11:58');

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

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

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

INSERT INTO `obat_masuks` (`id`, `nama_obat`, `kategori_id`, `satuan_id`, `sumber_dana`, `obat_id`, `supplier_id`, `user_id`, `kode_batch`, `barcode`, `stok`, `harga_beli`, `harga_jual`, `tanggal_penerimaan`, `tanggal_kadaluarsa`, `no_faktur`, `no_sbbk`, `catatan`, `created_at`, `updated_at`) VALUES
(1, 'Paracetamol 500mg', 1, 1, NULL, 1, 1, 1, 'BCH-2024-001', NULL, 100, 1500.00, 2500.00, '2025-11-24', '2026-06-24', 'FKT-001', NULL, NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(2, 'Ibuprofen 400mg', 1, 1, NULL, 2, 1, 1, 'BCH-2024-002', NULL, 79, 2000.00, 3500.00, '2025-11-29', '2026-02-07', 'FKT-002', NULL, NULL, '2025-12-24 04:52:26', '2026-02-02 20:12:25'),
(3, 'Amoxicillin 500mg', 2, 2, NULL, 3, 2, 1, 'BCH-2024-003', NULL, 149, 3000.00, 5000.00, '2025-12-04', '2026-12-24', 'FKT-003', NULL, NULL, '2025-12-24 04:52:26', '2026-02-01 20:14:12'),
(4, 'Ciprofloxacin 500mg', 2, 1, NULL, 4, 2, 1, 'BCH-2024-004', NULL, 60, 4000.00, 6500.00, '2025-12-09', '2026-01-13', 'FKT-004', NULL, NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(5, 'Aspirin 100mg', 3, 1, NULL, 5, 3, 1, 'BCH-2024-005', NULL, 200, 1000.00, 1800.00, '2025-12-14', '2026-03-09', 'FKT-005', NULL, NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(6, 'Amlodipine 5mg', 4, 1, NULL, 6, 1, 1, 'BCH-2024-006', NULL, 118, 2500.00, 4000.00, '2025-12-19', '2026-08-24', 'FKT-006', NULL, NULL, '2025-12-24 04:52:26', '2026-02-15 08:11:11'),
(7, 'Captopril 25mg', 4, 1, NULL, 7, 2, 1, 'BCH-2024-007', NULL, 88, 1800.00, 3000.00, '2025-12-21', '2026-01-08', 'FKT-007', NULL, NULL, '2025-12-24 04:52:26', '2025-12-24 05:00:17');

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

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

CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Struktur dari tabel `reseps`
--

CREATE TABLE `reseps` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `no_resep` varchar(255) NOT NULL,
  `jenis_penjamin` enum('umum','BPJS Kes','BPJS Naker','Jamkesmas/KIS','R. Inap') NOT NULL DEFAULT 'umum',
  `jenis_layanan` enum('BP','KIA','Gigi','UGD','Lainnya') NOT NULL DEFAULT 'BP',
  `user_id` bigint(20) UNSIGNED NOT NULL,
  `nama_dokter` varchar(255) DEFAULT NULL,
  `no_sip` varchar(255) DEFAULT NULL,
  `nama_pasien` varchar(255) NOT NULL,
  `no_rm` varchar(255) DEFAULT NULL,
  `umur_pasien` int(11) DEFAULT NULL,
  `berat_badan` decimal(5,2) DEFAULT NULL,
  `alamat_pasien` varchar(255) DEFAULT NULL,
  `jenis_kelamin` enum('L','P') DEFAULT NULL,
  `tanggal_resep` date NOT NULL,
  `diagnosa` text DEFAULT NULL,
  `catatan` text DEFAULT NULL,
  `status` enum('proses','selesai','dibatalkan') DEFAULT 'proses',
  `is_read` tinyint(1) NOT NULL DEFAULT 0,
  `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 `reseps`
--

INSERT INTO `reseps` (`id`, `no_resep`, `jenis_penjamin`, `jenis_layanan`, `user_id`, `nama_dokter`, `no_sip`, `nama_pasien`, `no_rm`, `umur_pasien`, `berat_badan`, `alamat_pasien`, `jenis_kelamin`, `tanggal_resep`, `diagnosa`, `catatan`, `status`, `is_read`, `created_at`, `updated_at`) VALUES
(1, 'RSP-20260202-0001', 'umum', 'BP', 2, NULL, NULL, 'sakina', NULL, 21, NULL, 'nganjuk', NULL, '2026-02-02', 'batuk', NULL, 'selesai', 1, '2026-02-01 20:14:12', '2026-02-10 07:15:45'),
(2, 'RSP-20260203-0001', 'umum', 'BP', 2, NULL, NULL, 'elsa', NULL, 21, NULL, 'nganjuk', NULL, '2026-02-03', 'batuk', NULL, 'selesai', 1, '2026-02-02 20:12:25', '2026-02-08 18:43:51'),
(3, 'RSP-20260210-0001', 'umum', 'BP', 2, 'Dokter', '1', 'a', '1', 22, 22.00, 'a', 'L', '2026-02-10', 'q', NULL, 'selesai', 1, '2026-02-10 07:20:40', '2026-02-13 08:24:48'),
(4, 'RSP-20260215-0001', 'umum', 'UGD', 2, 'Sumanto Spjp', '3121', 'Zeril', '030475', 3, 29.00, 'Jalan sumolawang', 'L', '2026-02-15', 'Cholera', 'asdasd', 'selesai', 1, '2026-02-15 08:11:11', '2026-02-15 08:11:58');

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

--
-- Struktur dari tabel `resep_items`
--

CREATE TABLE `resep_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `resep_id` bigint(20) UNSIGNED NOT NULL,
  `obat_masuk_id` bigint(20) UNSIGNED NOT NULL,
  `nama_obat` varchar(255) NOT NULL,
  `jumlah` int(11) NOT NULL,
  `aturan_pakai` varchar(255) 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 `resep_items`
--

INSERT INTO `resep_items` (`id`, `resep_id`, `obat_masuk_id`, `nama_obat`, `jumlah`, `aturan_pakai`, `created_at`, `updated_at`) VALUES
(1, 1, 3, 'Amoxicillin 500mg', 1, '3x1', '2026-02-01 20:14:12', '2026-02-01 20:14:12'),
(2, 2, 2, 'Ibuprofen 400mg', 1, '3x1', '2026-02-02 20:12:25', '2026-02-02 20:12:25'),
(3, 3, 6, 'Amlodipine 5mg', 1, '2', '2026-02-10 07:20:40', '2026-02-10 07:20:40'),
(4, 4, 6, 'Amlodipine 5mg', 1, '2x1 hari', '2026-02-15 08:11:11', '2026-02-15 08:11:11');

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

--
-- Struktur dari tabel `satuans`
--

CREATE TABLE `satuans` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama` varchar(255) NOT NULL,
  `keterangan` varchar(255) 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-24 04:52:26', '2025-12-24 04:52:26'),
(2, 'Kapsul', 'Obat dalam bentuk kapsul', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(3, 'Botol', 'Obat cair dalam botol', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(4, 'Strip', 'Obat dalam kemasan strip', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(5, 'Box', 'Obat dalam kemasan box', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(6, 'Ampul', 'Obat injeksi dalam ampul', '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(7, 'Tube', 'Obat salep/krim dalam tube', '2025-12-24 04:52:26', '2025-12-24 04:52:26');

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

--
-- 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
('1g3NQU9PNE9FQ0rvC1N3ned4PHXx0sIEbrsLRxUn', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoidEhLbXp0ME5Jbm1scUMwWG0zMHNCbGRRanRlUXFiaWRKbHlpbTlFTSI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771901099),
('9bKoAehhblz7fX4QRAJWTPj1TNsbxcKlJvcixar6', 1, '103.47.132.3', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoieDJiOGlPR01YNEpnZzFHZFhuNHM4YUV3WFd4WGlVbklwYUtjNDJwVyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mjc6Imh0dHA6Ly9tZWRvcnkubXkuaWQvbGFwb3JhbiI7czo1OiJyb3V0ZSI7czoxMzoibGFwb3Jhbi5pbmRleCI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', 1771905550),
('g0n8avzVw75To8mj6PdeIGnazvxnzx9r54IVoK7A', 1, '114.5.109.115', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoibEh6andaYkF3NEpKb0JvVU1WMnJwVDNKN0VzN0wwUkRkaEw0aXUxMSI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mjg6Imh0dHBzOi8vbWVkb3J5Lm15LmlkL3Byb2ZpbGUiO3M6NToicm91dGUiO3M6MTI6InByb2ZpbGUuZWRpdCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', 1771901915),
('gVxifbxk3gC95ALrQNEyR7Fxm5Fb9IdL3i53oGMz', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoidDlxTmJyZHNSSnowaUpIbEZmMHdyZXBraUwwZlNuY2pCZmtKSzFWYiI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771903034),
('kEUk9HMFphkzhmnZGbrlh8NkfVADsqDKZi3WFHlu', NULL, '103.22.242.5', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiaXNWZE1jZjN0cmRxaW5yeGZmektkd0xKckczcDN0UU9xbVVIdlczSyI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjY6Imh0dHBzOi8vbWVkb3J5Lm15LmlkL2xvZ2luIjtzOjU6InJvdXRlIjtzOjU6ImxvZ2luIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771904688),
('kWxA6pifHGIShUmw171i7iaWZx83ufptkw94PZIV', NULL, '117.103.171.5', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiSEg0ZHZIWnl0MHgxc1llNFRUQmRXck5DSnRNSG1CYW5yZ1l4aDVhViI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czoyNjoiaHR0cHM6Ly9tZWRvcnkubXkuaWQvcmVzZXAiO31zOjk6Il9wcmV2aW91cyI7YToyOntzOjM6InVybCI7czoyNjoiaHR0cHM6Ly9tZWRvcnkubXkuaWQvbG9naW4iO3M6NToicm91dGUiO3M6NToibG9naW4iO31zOjY6Il9mbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX19', 1771904719),
('LzU9kxWAhGdDTbxY6ulTkB4xD6pwcyTnkEdGeeGs', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoiMjEzQ3pQZkxBWHR2b0ZIQjFPZUJCOFJxY3ppOFlHWExDbXAyRGU1diI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771903012),
('NJ602ailiCYWtPwJ733AAzUbiu0zjy2WP5JbKvDl', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoiVE12NGxLa2lHMlZkcE1tZWQ5WUlMaURuTUtMNlBVUUZBR3RIM3pYSyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771903823),
('oWu1f2obqftNFn8lAEQDPM01nHyOKiNPCNEr8D9b', NULL, '103.189.123.8', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTozOntzOjY6Il90b2tlbiI7czo0MDoiajZqeXJHZWgwMWpKcUR4ZFV1Z0JGc1N2cTNwQTZpRGsyOUdBZHBLUiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjY6Imh0dHBzOi8vbWVkb3J5Lm15LmlkL2xvZ2luIjtzOjU6InJvdXRlIjtzOjU6ImxvZ2luIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771904666),
('pEaBL9XBz9yhVbVnj7QP9PYhncndRsDrskQld8sI', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoiM21WUXJ0ZlFjVDltRElpQWhONGVnZzFlWmtHNUlJcjNMOVN4bmZiQyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771901475),
('PH9UfXWkZDRb0kR0vgIQZMnbuIfCkRQ5gwBEgMeO', 2, '36.79.208.192', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoib3BRd1hNQzdkUmxyVjZQcHo4TjZmdTZyblhMSzF2cXBRb0ZFeVNGciI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mjg6Imh0dHBzOi8vbWVkb3J5Lm15LmlkL3Byb2ZpbGUiO3M6NToicm91dGUiO3M6MTI6InByb2ZpbGUuZWRpdCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjI7fQ==', 1771902801),
('R3R6fptYdUCdWWSXRvG846vWByqjTwTfkJYImKNH', NULL, '175.45.186.196', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoicElydDFubzd0dWJxYUdPUVd3NjRZMXlXNDBnd3NNdlpsUWVWS1NqMSI7czozOiJ1cmwiO2E6MTp7czo4OiJpbnRlbmRlZCI7czozMDoiaHR0cHM6Ly9tZWRvcnkubXkuaWQvZGFzaGJvYXJkIjt9czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjY6Imh0dHBzOi8vbWVkb3J5Lm15LmlkL2xvZ2luIjtzOjU6InJvdXRlIjtzOjU6ImxvZ2luIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771904687),
('Se0qp3o9aoWVH67XLfUkeXil7couCQFq23zJF8HI', 1, '36.79.208.192', 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Mobile Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoiZWFoaXRQNkRmZE5XVkp5dTR5bGRlaHlUWWFSM1ZrZXJwb1VIREEwaiI7czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6Mjg6Imh0dHBzOi8vbWVkb3J5Lm15LmlkL3Byb2ZpbGUiO3M6NToicm91dGUiO3M6MTI6InByb2ZpbGUuZWRpdCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjE7fQ==', 1771904090),
('SUhF1hfELv5CcNoSdCsxJRnHalfjROwRVE23C8Tr', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoiT1VjQ0t0N1d1TUdMWmJ1bENYSjFCTkNldUVvUER5Rm5Wbk9LQnhMdyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771903000),
('UzTpFQbyY333ql8ftUi3tbwwX0NNeX6IUx6lUuCM', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoibDN0dDlLczhXYkpjZ0t2MHlwV2UyQ25DZ2xNRFNyQjNrbkhQZVRGYyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771905580),
('yD6o4MW50WcfNU5c0UxkBBaBMu0hOKwoQJdPyNIT', NULL, '195.88.211.210', '', 'YToyOntzOjY6Il90b2tlbiI7czo0MDoiZEZaalJlU0VhVnBDSkM1bXRyckNFMFhCazdXWXF6cE1NY29vZEZWTCI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319fQ==', 1771901045),
('yQXyf3tedUwzU8s7pJXnRzjI3Q6GS3RpSrtx9VxP', 2, '114.10.41.74', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36', 'YTo0OntzOjY6Il90b2tlbiI7czo0MDoicXBNaWZOa0VqaEVaR2dRTTNsR1FEMWdoc3ljSHJFMTQ5OGVlOERhMyI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6Mjp7czozOiJ1cmwiO3M6MjY6Imh0dHBzOi8vbWVkb3J5Lm15LmlkL3Jlc2VwIjtzOjU6InJvdXRlIjtzOjExOiJyZXNlcC5pbmRleCI7fXM6NTA6ImxvZ2luX3dlYl81OWJhMzZhZGRjMmIyZjk0MDE1ODBmMDE0YzdmNThlYTRlMzA5ODlkIjtpOjI7fQ==', 1771904714);

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

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

CREATE TABLE `suppliers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `nama` varchar(255) NOT NULL,
  `alamat` text DEFAULT NULL,
  `telepon` varchar(255) DEFAULT NULL,
  `email` varchar(255) 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-24 04:52:26', '2025-12-24 04:52:26'),
(2, 'PT Kalbe Farma', 'Jakarta Timur', '021-7654321', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26'),
(3, 'PT Sanbe Farma', 'Bandung', '022-1234567', NULL, '2025-12-24 04:52:26', '2025-12-24 04:52:26');

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

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

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `nip` varchar(255) DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `division` varchar(255) DEFAULT NULL,
  `position` varchar(255) DEFAULT NULL,
  `profile_photo` varchar(255) DEFAULT NULL,
  `role` enum('dokter','apoteker') NOT NULL DEFAULT 'apoteker',
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(100) 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`, `nip`, `email`, `phone`, `gender`, `address`, `division`, `position`, `profile_photo`, `role`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Admin', '0987644876590', 'admin@admin.com', '081333940999', NULL, 'RB konveksi, darungan, babadan', 'apoteker', '-', 'profile-photos/Yp1w8l0LBt5TDVRNRAcmjUXToe7Z01wzo5I2V4yj.png', 'apoteker', NULL, '$2y$12$ezU30KN/7LX0OIaEKB4gxuU.fO/wfMVWk/KCCbyN24xelql7A688i', 'eEkWkkHR5zTNqOh1YT4Rd0S0TUMuwxqIWG4KyEDKcn4ZOc1gU2Vtl0Me0yAo', '2025-12-24 04:52:26', '2026-02-23 09:40:39'),
(2, 'Dokter', NULL, 'dokter@dokter.com', NULL, NULL, NULL, NULL, NULL, 'profile-photos/frOqnRsuJM56tmZiqWOAfu7iqNSIKgHBr6XMFCMK.jpg', 'dokter', '2026-02-01 00:18:12', '$2y$12$8RaiDGJxOjydcah39s2uWO.OsLn.0MLOayk82E/pPpofsQiRcD/MG', NULL, '2026-02-01 00:18:12', '2026-02-23 09:30:25');

--
-- 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 `reseps`
--
ALTER TABLE `reseps`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `reseps_no_resep_unique` (`no_resep`),
  ADD KEY `reseps_user_id_foreign` (`user_id`);

--
-- Indeks untuk tabel `resep_items`
--
ALTER TABLE `resep_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `resep_items_resep_id_foreign` (`resep_id`),
  ADD KEY `resep_items_obat_masuk_id_foreign` (`obat_masuk_id`);

--
-- 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(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 `kategoris`
--
ALTER TABLE `kategoris`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT untuk tabel `suppliers`
--
ALTER TABLE `suppliers`
  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=3;

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

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

--
-- Ketidakleluasaan untuk tabel `resep_items`
--
ALTER TABLE `resep_items`
  ADD CONSTRAINT `resep_items_obat_masuk_id_foreign` FOREIGN KEY (`obat_masuk_id`) REFERENCES `obat_masuks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `resep_items_resep_id_foreign` FOREIGN KEY (`resep_id`) REFERENCES `reseps` (`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 */;
