-- https://www.phpmyadmin.net/
--
-- Waktu pembuatan: 07 Jul 2024 pada 13.50
-- Versi server: 8.0.30
-- Versi PHP: 8.1.10

START TRANSACTION;



--
-- Database: `db_pakar_fc`
--

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

--
-- Struktur dari tabel `activity_log`
--

CREATE TABLE `activity_log` (
  `id` bigint UNSIGNED NOT NULL,
  `log_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject_id` bigint UNSIGNED DEFAULT NULL,
  `causer_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `causer_id` bigint UNSIGNED DEFAULT NULL,
  `properties` json DEFAULT NULL,
  `batch_uuid` char(36) 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;

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

--
-- Struktur dari tabel `diagnoses`
--

CREATE TABLE `diagnoses` (
  `id` bigint UNSIGNED NOT NULL,
  `user_id` bigint UNSIGNED NOT NULL,
  `selected_symptoms` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `result` varchar(255) 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;

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

--
-- Struktur dari tabel `education`
--

CREATE TABLE `education` (
  `id` bigint UNSIGNED NOT NULL,
  `category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `video1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `video2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `video3` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `video4` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `video5` 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 `education`
--

INSERT INTO `education` (`id`, `category`, `video1`, `video2`, `video3`, `video4`, `video5`, `created_at`, `updated_at`) VALUES
(1, 'White scours', '1720098439_cara mengobati mencret anak babi.mp4', NULL, NULL, NULL, NULL, '2024-07-04 06:07:20', '2024-07-04 06:07:20'),
(2, 'Erisipelas', '1720098574_Y2meta.app-Mengenal Erysipelas pada babi-(720p).mp4', NULL, NULL, NULL, NULL, '2024-07-04 06:09:35', '2024-07-04 06:09:35'),
(3, 'Ho cholera', '1720099156_Y2meta.app - Vaksinasi Hog Cholera Pada Babi (@Sobat Petani Ternak).mp4', NULL, NULL, NULL, NULL, '2024-07-04 06:19:17', '2024-07-04 06:19:17'),
(4, 'African Swine Fever (ASF)', '1720099309_Y2meta.app - Edukasi Sederhana _ Pengenalan Virus ASF (African Swine Fever).mp4', NULL, NULL, NULL, NULL, '2024-07-04 06:21:49', '2024-07-04 06:21:49');

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

--
-- 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 `gejalas`
--

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

INSERT INTO `gejalas` (`id`, `code`, `name`, `created_at`, `updated_at`) VALUES
(1, 'G01', 'Babi sangat kesakitan saat sedang buang kotoran', '2024-07-04 05:23:02', '2024-07-04 05:34:53'),
(2, 'G02', 'Kelopak mata membengkak', '2024-07-04 05:23:49', '2024-07-04 05:35:10'),
(3, 'G03', 'Kurang nafsu untuk menyusui', '2024-07-04 05:24:15', '2024-07-04 05:35:26'),
(4, 'G04', 'Bulu kusam', '2024-07-04 05:24:49', '2024-07-04 05:35:39'),
(5, 'G05', 'Kejang-kejang', '2024-07-04 05:25:55', '2024-07-04 05:35:53'),
(6, 'G06', 'Nafas tersengal-sengal', '2024-07-04 05:26:25', '2024-07-04 05:36:06'),
(7, 'G07', 'Leher Bengkak', '2024-07-04 05:30:34', '2024-07-04 05:36:18'),
(8, 'G08', 'Kehilangan nafsu makan', '2024-07-04 05:31:11', '2024-07-04 05:36:33'),
(9, 'G09', 'Lesi kulit berupa bercak-bercak merah atau ungu', '2024-07-04 05:31:54', '2024-07-04 05:36:47'),
(10, 'G10', 'Demam tinggi, kehilangan nafsu makan', '2024-07-04 05:32:31', '2024-07-04 05:32:31'),
(11, 'G11', 'Depresi yang terlihat jelas pada hewan yang terinfeksi', '2024-07-04 05:33:01', '2024-07-04 05:37:22'),
(12, 'G12', 'Mengalami pertumbuhan yang terhambat', '2024-07-04 05:34:39', '2024-07-04 05:37:35'),
(13, 'G13', 'Penurunan berat badan', '2024-07-04 05:37:52', '2024-07-04 05:37:52'),
(14, 'G14', 'Demam Tinggi', '2024-07-04 05:38:13', '2024-07-04 05:38:13'),
(15, 'G15', 'Kehilangan nafsu makan', '2024-07-04 05:38:47', '2024-07-04 05:38:47'),
(16, 'G16', 'Bintik-bintik merah', '2024-07-04 05:40:11', '2024-07-04 05:40:11'),
(17, 'G17', 'Kelemahan yang signifikan', '2024-07-04 05:40:43', '2024-07-04 05:40:43');

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

--
-- Struktur dari tabel `knowlidges`
--

CREATE TABLE `knowlidges` (
  `id` bigint UNSIGNED NOT NULL,
  `gejala_id` bigint UNSIGNED DEFAULT NULL,
  `penyakit_id` bigint UNSIGNED 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 `knowlidges`
--

INSERT INTO `knowlidges` (`id`, `gejala_id`, `penyakit_id`, `created_at`, `updated_at`) VALUES
(1, 1, 1, '2024-07-04 06:33:04', '2024-07-04 07:07:11'),
(2, 2, 1, '2024-07-04 06:33:21', '2024-07-04 06:33:21'),
(3, 3, 1, '2024-07-04 06:33:49', '2024-07-04 06:33:49'),
(4, 4, 1, '2024-07-04 06:34:10', '2024-07-04 06:34:10'),
(5, 5, 2, '2024-07-04 06:34:30', '2024-07-04 06:34:30'),
(6, 6, 2, '2024-07-04 06:34:54', '2024-07-04 06:34:54'),
(7, 7, 2, '2024-07-04 06:35:38', '2024-07-04 06:35:38'),
(8, 8, 2, '2024-07-04 06:36:29', '2024-07-04 06:36:29'),
(9, 9, 2, '2024-07-04 06:36:44', '2024-07-04 06:36:44'),
(10, 10, 3, '2024-07-04 06:37:09', '2024-07-04 06:37:09'),
(11, 11, 3, '2024-07-04 06:37:23', '2024-07-04 06:37:23'),
(12, 12, 3, '2024-07-04 06:37:51', '2024-07-04 06:37:51'),
(13, 13, 3, '2024-07-04 06:38:26', '2024-07-04 06:38:26'),
(14, 14, 4, '2024-07-04 06:39:01', '2024-07-04 06:39:01'),
(15, 15, 4, '2024-07-04 06:39:17', '2024-07-04 06:39:17'),
(16, 16, 4, '2024-07-04 06:39:41', '2024-07-04 06:39:41'),
(17, 17, 4, '2024-07-04 06:39:57', '2024-07-04 06:39:57');

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

--
-- 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, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_reset_tokens_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2023_09_10_171611_create_gejalas_table', 1),
(6, '2023_09_10_171630_create_penyakit_table', 1),
(7, '2023_09_10_171709_create_knowlidges_table', 1),
(8, '2023_09_20_181250_create_diagnoses_table', 1),
(9, '2023_09_21_194728_create_rule_table', 1),
(10, '2023_09_28_091256_create_education_table', 1),
(11, '2023_10_13_191733_create_activity_log_table', 1),
(12, '2023_10_13_191734_add_event_column_to_activity_log_table', 1),
(13, '2023_10_13_191735_add_batch_uuid_column_to_activity_log_table', 1);

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

--
-- Struktur dari tabel `penyakit`
--

CREATE TABLE `penyakit` (
  `id` bigint UNSIGNED NOT NULL,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `education_id` bigint UNSIGNED 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 `penyakit`
--

INSERT INTO `penyakit` (`id`, `code`, `name`, `description`, `education_id`, `created_at`, `updated_at`) VALUES
(1, 'P1', 'White scours (mencret putih)', 'Harus memberikan tempat yang tepat dan pengobatan menggunakan penicillin, treptomycin dan teramycin', 1, '2024-07-04 06:12:21', '2024-07-04 06:14:12'),
(2, 'P2', 'Erisipelas', 'Harus divaksin erysipelas dan pengobatan menggunakan penisilin, injekfit b-ples, medoxi-la, dan feredex', NULL, '2024-07-04 06:15:28', '2024-07-04 06:15:28'),
(3, 'P3', 'Ho cholera', 'Harus di vaksin dan pengobatan menggunakan antibiotic, antipiretik\r\nProgram vaksinasi : Anak babi : umur 6-8 minggu, Induk Babi : 3 minggu sebelum kawin, Jantan : disesuaikan (2 x setahun).', NULL, '2024-07-04 06:22:44', '2024-07-04 06:22:44'),
(4, 'P4', 'African Swine Fever (ASF)', 'Menerapan biosekuriti, manajemen peternakan babi yang baik, serta pengawasan yang ketat dan intensif untuk daerah yang berisiko tinggi', NULL, '2024-07-04 06:23:28', '2024-07-04 06:23:28');

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

--
-- Struktur dari tabel `rule`
--

CREATE TABLE `rule` (
  `id` bigint UNSIGNED NOT NULL,
  `gejala_id` bigint UNSIGNED NOT NULL,
  `penyakit_id` bigint UNSIGNED 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 `activity_log`
--
ALTER TABLE `activity_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subject` (`subject_type`,`subject_id`),
  ADD KEY `causer` (`causer_type`,`causer_id`),
  ADD KEY `activity_log_log_name_index` (`log_name`);

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

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

--
-- Indeks untuk tabel `knowlidges`
--
ALTER TABLE `knowlidges`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `knowlidges_gejala_id_kerusakan_id_unique` (`gejala_id`,`penyakit_id`),
  ADD KEY `knowlidges_kerusakan_id_foreign` (`penyakit_id`);

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

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

--
-- Indeks untuk tabel `rule`
--
ALTER TABLE `rule`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rule_gejala_id_kerusakan_id_unique` (`gejala_id`,`penyakit_id`),
  ADD KEY `rule_kerusakan_id_foreign` (`penyakit_id`);

--
-- AUTO_INCREMENT untuk tabel yang dibuang
--

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

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

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

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

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

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

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

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

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

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

--
-- Ketidakleluasaan untuk tabel `knowlidges`
--
ALTER TABLE `knowlidges`
  ADD CONSTRAINT `knowlidges_gejala_id_foreign` FOREIGN KEY (`gejala_id`) REFERENCES `gejalas` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `knowlidges_kerusakan_id_foreign` FOREIGN KEY (`penyakit_id`) REFERENCES `penyakit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Ketidakleluasaan untuk tabel `rule`
--
ALTER TABLE `rule`
  ADD CONSTRAINT `rule_gejala_id_foreign` FOREIGN KEY (`gejala_id`) REFERENCES `gejalas` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `rule_kerusakan_id_foreign` FOREIGN KEY (`penyakit_id`) REFERENCES `penyakit` (`id`) ON DELETE CASCADE;
COMMIT;

