-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 29, 2024 at 01:44 PM
-- Server version: 8.0.30
-- PHP Version: 7.3.31

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

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

--
-- Table structure for table `aktivitas`
--

CREATE TABLE `aktivitas` (
  `id` bigint UNSIGNED NOT NULL,
  `nama` 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 for table `aktivitas`
--

INSERT INTO `aktivitas` (`id`, `nama`, `created_at`, `updated_at`) VALUES
(1, 'Ringan', '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(2, 'Sedang', '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(3, 'Berat', '2024-03-29 05:43:21', '2024-03-29 05:43:21');

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

--
-- Table structure for table `detail_makanan`
--

CREATE TABLE `detail_makanan` (
  `id` bigint UNSIGNED NOT NULL,
  `makanan_id` bigint UNSIGNED NOT NULL,
  `waktu` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_makanan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `berat` double NOT NULL,
  `kalori` double 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 `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;

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

--
-- Table structure for table `jenis_kelamin`
--

CREATE TABLE `jenis_kelamin` (
  `id` bigint UNSIGNED NOT NULL,
  `jenis_kelamin` 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 for table `jenis_kelamin`
--

INSERT INTO `jenis_kelamin` (`id`, `jenis_kelamin`, `created_at`, `updated_at`) VALUES
(1, 'Laki-Laki', '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(2, 'Perempuan', '2024-03-29 05:43:21', '2024-03-29 05:43:21');

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

--
-- Table structure for table `kadar_gula`
--

CREATE TABLE `kadar_gula` (
  `id` bigint UNSIGNED NOT NULL,
  `kadar_gula` 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 for table `kadar_gula`
--

INSERT INTO `kadar_gula` (`id`, `kadar_gula`, `created_at`, `updated_at`) VALUES
(1, 'Normal - (70 - 193)', '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(2, 'Pre Diabetes - (140 - 199)', '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(3, 'Diabetes - (>= 200)', '2024-03-29 05:43:21', '2024-03-29 05:43:21');

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

--
-- Table structure for table `kebutuhan_kalori`
--

CREATE TABLE `kebutuhan_kalori` (
  `id` bigint UNSIGNED NOT NULL,
  `kebutuhan_kalori` int 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 `kebutuhan_kalori`
--

INSERT INTO `kebutuhan_kalori` (`id`, `kebutuhan_kalori`, `created_at`, `updated_at`) VALUES
(1, 1100, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(2, 1300, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(3, 1500, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(4, 1700, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(5, 1900, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(6, 2100, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(7, 2300, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(8, 2500, '2024-03-29 05:43:21', '2024-03-29 05:43:21');

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

--
-- Table structure for table `kriteria`
--

CREATE TABLE `kriteria` (
  `id` bigint UNSIGNED NOT NULL,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tipe_kriteria_id` bigint UNSIGNED NOT NULL,
  `bobot` double 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 `kriteria`
--

INSERT INTO `kriteria` (`id`, `nama`, `kode`, `tipe_kriteria_id`, `bobot`, `created_at`, `updated_at`) VALUES
(1, 'Karbohidrat', 'C1', 1, 0.3, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(2, 'Lemak', 'C2', 2, 0.25, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(3, 'Protein', 'C3', 1, 0.25, '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(4, 'Serat', 'C4', 1, 0.1, '2024-03-29 05:43:21', '2024-03-29 05:43:21');

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

--
-- Table structure for table `kriteria_makanan`
--

CREATE TABLE `kriteria_makanan` (
  `id` bigint UNSIGNED NOT NULL,
  `kriteria_id` bigint UNSIGNED NOT NULL,
  `makanan_id` bigint UNSIGNED NOT NULL,
  `nilai` double NOT NULL,
  `keterangan` int 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 `makanan`
--

CREATE TABLE `makanan` (
  `id` bigint UNSIGNED NOT NULL,
  `kode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kalori` int DEFAULT NULL,
  `alternatif` 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;

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

--
-- Table structure for table `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 for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2024_02_27_004425_create_kebutuhan_kalori_table', 1),
(6, '2024_03_02_004256_create_kadar_gula_table', 1),
(7, '2024_03_07_140843_create_jenis_kelamin_table', 1),
(8, '2024_03_07_140900_create_aktivitas_table', 1),
(9, '2024_03_07_141620_create_tipe_kriteria_table', 1),
(10, '2024_03_07_141639_create_makanan_table', 1),
(11, '2024_03_08_003124_create_pasien_table', 1),
(12, '2024_03_09_055535_create_kriteria_table', 1),
(13, '2024_03_12_025108_create_kriteria_makanan_table', 1),
(14, '2024_03_12_025353_create_detail_makanan_table', 1);

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

--
-- Table structure for table `pasien`
--

CREATE TABLE `pasien` (
  `id` bigint UNSIGNED NOT NULL,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `jenis_kelamin_id` bigint UNSIGNED NOT NULL,
  `umur` int NOT NULL,
  `berat` double NOT NULL,
  `tinggi` double NOT NULL,
  `aktivitas_id` bigint UNSIGNED NOT NULL,
  `kadar_gula_id` bigint UNSIGNED NOT NULL,
  `kebutuhan_kalori_id` bigint UNSIGNED NOT NULL,
  `status` enum('Underweight',' Normal','Overweight','Obesitas') 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 `password_resets`
--

CREATE TABLE `password_resets` (
  `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;

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

--
-- Table structure for table `personal_access_tokens`
--

CREATE TABLE `personal_access_tokens` (
  `id` bigint UNSIGNED NOT NULL,
  `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `abilities` text COLLATE utf8mb4_unicode_ci,
  `last_used_at` timestamp NULL 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 `tipe_kriteria`
--

CREATE TABLE `tipe_kriteria` (
  `id` bigint UNSIGNED NOT NULL,
  `nama` 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 for table `tipe_kriteria`
--

INSERT INTO `tipe_kriteria` (`id`, `nama`, `created_at`, `updated_at`) VALUES
(1, 'Benefit', '2024-03-29 05:43:21', '2024-03-29 05:43:21'),
(2, 'Cost', '2024-03-29 05:43:21', '2024-03-29 05:43:21');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_lengkap` 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 for table `users`
--

INSERT INTO `users` (`id`, `name`, `nama_lengkap`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Admin', 'Admin', 'anandacahya.com@gmail.com', '2024-03-10 11:29:38', '$2y$10$ZK1RHZH4Ac4.831bZ//jke4AySWPP1tSQEpzb1KncyIyc.5ajaMu6', NULL, '2024-03-29 05:43:21', '2024-03-29 05:43:21');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `aktivitas`
--
ALTER TABLE `aktivitas`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `detail_makanan`
--
ALTER TABLE `detail_makanan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `detail_makanan_makanan_id_foreign` (`makanan_id`);

--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);

--
-- Indexes for table `jenis_kelamin`
--
ALTER TABLE `jenis_kelamin`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `kadar_gula`
--
ALTER TABLE `kadar_gula`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `kebutuhan_kalori`
--
ALTER TABLE `kebutuhan_kalori`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `kriteria`
--
ALTER TABLE `kriteria`
  ADD PRIMARY KEY (`id`),
  ADD KEY `kriteria_tipe_kriteria_id_foreign` (`tipe_kriteria_id`);

--
-- Indexes for table `kriteria_makanan`
--
ALTER TABLE `kriteria_makanan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `kriteria_makanan_kriteria_id_foreign` (`kriteria_id`),
  ADD KEY `kriteria_makanan_makanan_id_foreign` (`makanan_id`);

--
-- Indexes for table `makanan`
--
ALTER TABLE `makanan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pasien`
--
ALTER TABLE `pasien`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pasien_jenis_kelamin_id_foreign` (`jenis_kelamin_id`),
  ADD KEY `pasien_aktivitas_id_foreign` (`aktivitas_id`),
  ADD KEY `pasien_kadar_gula_id_foreign` (`kadar_gula_id`),
  ADD KEY `pasien_kebutuhan_kalori_id_foreign` (`kebutuhan_kalori_id`);

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD KEY `password_resets_email_index` (`email`);

--
-- Indexes for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);

--
-- Indexes for table `tipe_kriteria`
--
ALTER TABLE `tipe_kriteria`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `aktivitas`
--
ALTER TABLE `aktivitas`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `detail_makanan`
--
ALTER TABLE `detail_makanan`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `jenis_kelamin`
--
ALTER TABLE `jenis_kelamin`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `kadar_gula`
--
ALTER TABLE `kadar_gula`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `kebutuhan_kalori`
--
ALTER TABLE `kebutuhan_kalori`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `kriteria`
--
ALTER TABLE `kriteria`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `kriteria_makanan`
--
ALTER TABLE `kriteria_makanan`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `makanan`
--
ALTER TABLE `makanan`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `pasien`
--
ALTER TABLE `pasien`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tipe_kriteria`
--
ALTER TABLE `tipe_kriteria`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `detail_makanan`
--
ALTER TABLE `detail_makanan`
  ADD CONSTRAINT `detail_makanan_makanan_id_foreign` FOREIGN KEY (`makanan_id`) REFERENCES `makanan` (`id`);

--
-- Constraints for table `kriteria`
--
ALTER TABLE `kriteria`
  ADD CONSTRAINT `kriteria_tipe_kriteria_id_foreign` FOREIGN KEY (`tipe_kriteria_id`) REFERENCES `tipe_kriteria` (`id`);

--
-- Constraints for table `kriteria_makanan`
--
ALTER TABLE `kriteria_makanan`
  ADD CONSTRAINT `kriteria_makanan_kriteria_id_foreign` FOREIGN KEY (`kriteria_id`) REFERENCES `kriteria` (`id`),
  ADD CONSTRAINT `kriteria_makanan_makanan_id_foreign` FOREIGN KEY (`makanan_id`) REFERENCES `makanan` (`id`);

--
-- Constraints for table `pasien`
--
ALTER TABLE `pasien`
  ADD CONSTRAINT `pasien_aktivitas_id_foreign` FOREIGN KEY (`aktivitas_id`) REFERENCES `aktivitas` (`id`),
  ADD CONSTRAINT `pasien_jenis_kelamin_id_foreign` FOREIGN KEY (`jenis_kelamin_id`) REFERENCES `jenis_kelamin` (`id`),
  ADD CONSTRAINT `pasien_kadar_gula_id_foreign` FOREIGN KEY (`kadar_gula_id`) REFERENCES `kadar_gula` (`id`),
  ADD CONSTRAINT `pasien_kebutuhan_kalori_id_foreign` FOREIGN KEY (`kebutuhan_kalori_id`) REFERENCES `kebutuhan_kalori` (`id`);
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 */;
