-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `wisnu2`
--

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

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

CREATE TABLE `aktivitas` (
  `id` int(11) NOT NULL,
  `nama_aktivitas` varchar(255) NOT NULL,
  `deskripsi` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `aktivitas`
--

INSERT INTO `aktivitas` (`id`, `nama_aktivitas`, `deskripsi`, `created_at`) VALUES
(1, 'Mengajar di Kelas', 'Kegiatan pembelajaran di dalam kelas', '2026-07-29 07:46:01'),
(2, 'Menyusun RPP', 'Menyusun Rencana Pelaksanaan Pembelajaran', '2026-07-29 07:46:01'),
(3, 'Mengoreksi Tugas', 'Mengoreksi tugas dan pekerjaan siswa', '2026-07-29 07:46:01'),
(4, 'Mengadakan Evaluasi', 'Melaksanakan evaluasi pembelajaran', '2026-07-29 07:46:01'),
(5, 'Bimbingan Siswa', 'Memberikan bimbingan kepada siswa', '2026-07-29 07:46:01'),
(6, 'Mengikuti Rapat', 'Mengikuti rapat koordinasi guru', '2026-07-29 07:46:01'),
(7, 'Pengembangan Diri', 'Mengikuti pelatihan/workshop untuk pengembangan kompetensi', '2026-07-29 07:46:01'),
(8, 'Menyusun Laporan', 'Menyusun laporan kegiatan pembelajaran', '2026-07-29 07:46:01');

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

--
-- Table structure for table `jurnal_detail`
--

CREATE TABLE `jurnal_detail` (
  `id` int(11) NOT NULL,
  `jurnal_id` int(11) NOT NULL,
  `aktivitas_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `jurnal_detail`
--

INSERT INTO `jurnal_detail` (`id`, `jurnal_id`, `aktivitas_id`) VALUES
(14, 6, 5),
(15, 6, 4),
(16, 6, 1),
(17, 7, 3),
(18, 7, 8),
(19, 7, 2),
(20, 7, 7);

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

--
-- Table structure for table `jurnal_kinerja`
--

CREATE TABLE `jurnal_kinerja` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `jam` time NOT NULL,
  `isi_jurnal` text NOT NULL,
  `status` enum('pending','disetujui','ditolak') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `jurnal_kinerja`
--

INSERT INTO `jurnal_kinerja` (`id`, `user_id`, `tanggal`, `jam`, `isi_jurnal`, `status`, `created_at`) VALUES
(6, 1, '2026-07-29', '00:00:00', 'fdsafds', 'disetujui', '2026-07-29 08:04:12'),
(7, 1, '2026-07-29', '15:46:00', 'fdasfdas\r\n', 'pending', '2026-07-29 08:46:38');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `jurnal_detail`
--
ALTER TABLE `jurnal_detail`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jurnal_id` (`jurnal_id`),
  ADD KEY `aktivitas_id` (`aktivitas_id`);

--
-- Indexes for table `jurnal_kinerja`
--
ALTER TABLE `jurnal_kinerja`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `aktivitas`
--
ALTER TABLE `aktivitas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `jurnal_detail`
--
ALTER TABLE `jurnal_detail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `jurnal_kinerja`
--
ALTER TABLE `jurnal_kinerja`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `jurnal_detail`
--
ALTER TABLE `jurnal_detail`
  ADD CONSTRAINT `jurnal_detail_ibfk_1` FOREIGN KEY (`jurnal_id`) REFERENCES `jurnal_kinerja` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `jurnal_detail_ibfk_2` FOREIGN KEY (`aktivitas_id`) REFERENCES `aktivitas` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `jurnal_kinerja`
--
ALTER TABLE `jurnal_kinerja`
  ADD CONSTRAINT `jurnal_kinerja_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

