-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 04, 2026 at 03:10 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.4.27

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

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

--
-- Table structure for table `attendance`
--

CREATE TABLE `attendance` (
  `id` int(11) NOT NULL,
  `student_id` int(11) DEFAULT NULL,
  `class_id` int(11) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `status` enum('Hadir','Sakit','Izin','Alpa') DEFAULT NULL,
  `teacher_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `attendance`
--

INSERT INTO `attendance` (`id`, `student_id`, `class_id`, `date`, `status`, `teacher_id`) VALUES
(1, 67, 18, '2026-04-28', '', 4),
(2, 68, 18, '2026-04-28', 'Hadir', 4),
(3, 69, 18, '2026-04-28', 'Sakit', 4),
(4, 70, 18, '2026-04-28', 'Izin', 4),
(5, 71, 18, '2026-04-28', 'Hadir', 4);

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

--
-- Table structure for table `classes`
--

CREATE TABLE `classes` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `unit` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `classes`
--

INSERT INTO `classes` (`id`, `name`, `unit`) VALUES
(1, 'Kelas 1A', 'Madrasah Ibtidaiyah'),
(14, 'KBK', 'Kelompok Bermain'),
(15, 'KBB', 'Kelompok Bermain'),
(16, 'RA A', 'Raudhatul Athfal'),
(17, 'RA B', 'Raudhatul Athfal'),
(18, 'MI 1A', 'Madrasah Ibtidaiyah'),
(19, 'MI 1B', 'Madrasah Ibtidaiyah'),
(20, 'MTs 8A', 'Madrasah Tsanawiyah'),
(21, 'MTs 9A', 'Madrasah Tsanawiyah'),
(23, 'Madrasah Aliyah', 'MA 10 Reguler'),
(24, 'MA 10 Reguler', 'Madrasah Aliyah');

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

--
-- Table structure for table `grades`
--

CREATE TABLE `grades` (
  `id` int(11) NOT NULL,
  `student_id` int(11) DEFAULT NULL,
  `class_id` int(11) DEFAULT NULL,
  `subject` varchar(100) DEFAULT NULL,
  `assignment_score` decimal(5,2) DEFAULT NULL,
  `mid_score` decimal(5,2) DEFAULT NULL,
  `final_score` decimal(5,2) DEFAULT NULL,
  `teacher_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `instrumen_supervisi`
--

CREATE TABLE `instrumen_supervisi` (
  `id` int(11) NOT NULL,
  `kode_formulir` varchar(50) DEFAULT NULL,
  `nama_formulir` varchar(200) DEFAULT NULL,
  `file_name` varchar(255) DEFAULT NULL,
  `original_name` varchar(255) DEFAULT NULL,
  `file_type` varchar(50) DEFAULT NULL,
  `file_size` int(11) DEFAULT NULL,
  `upload_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `instrumen_supervisi`
--

INSERT INTO `instrumen_supervisi` (`id`, `kode_formulir`, `nama_formulir`, `file_name`, `original_name`, `file_type`, `file_size`, `upload_date`) VALUES
(2, 'No.024/F/KPM/01/02/2025', 'FORMULIR PERMINTAAN TINDAKAN PERBAIKAN DAN PENCEGAHAN', '1777348513_F024-KPMFORMULIRPERMINTAANTINDAKANPERBAIKANDANPENCEGAHAN.doc', 'F 024-KPM FORMULIR PERMINTAAN TINDAKAN PERBAIKAN DAN PENCEGAHAN.doc', 'doc', 1159680, '2026-04-28 10:55:13'),
(3, 'No.025/F/KPM/01/02/2025', 'FORMULIR MONITORING TINDAKAN PERBAIKAN DAN PENCEGAHAN', '1777348536_F025-KPMFORMULIRMONITORINGTINDAKANPERBAIKANDANPENCEGAHAN.doc', 'F 025-KPM FORMULIR MONITORING TINDAKAN PERBAIKAN DAN PENCEGAHAN.doc', 'doc', 1153024, '2026-04-28 10:55:36'),
(4, 'No.  036/F/ KM-.../01/02/2025', 'FORMULIR INSTRUMEN TELAAH RPP/MODUL AJAR', '1777348582_F036-KMFORMULIRINSTRUMENTELAAHRPP-MODULAJAR.docx', 'F 036-KM FORMULIR INSTRUMEN TELAAH RPP-MODUL AJAR.docx', 'docx', 89239, '2026-04-28 10:56:22'),
(5, 'No.  037/F/ KM-.../01/02/2025', 'FORMULIR INSTRUMEN PELAKSANAAN SUPERVISI AKADEMIK', '1777348608_F037-KMFORMULIRINSTRUMENPELAKSANAANSUPERVISIAKADEMIK.docx', 'F 037-KM FORMULIR INSTRUMEN PELAKSANAAN SUPERVISI AKADEMIK .docx', 'docx', 2822349, '2026-04-28 10:56:48'),
(6, 'No.  038/F/ KM-.../01/02/2025', 'FORMULIR WAWANCARA PASCA SUPERVISI AKADEMIK ', '1777348640_F038-KMFORMULIRWAWANCARAPASCASUPERVISIAKADEMIK.docx', 'F 038-KM FORMULIR WAWANCARA PASCA SUPERVISI AKADEMIK .docx', 'docx', 80783, '2026-04-28 10:57:20'),
(7, '025 ', 'Formulir monitoring Catering', '1779412897_025.FormMonitoring_Catering.pdf', '025. Form Monitoring _Catering.pdf', 'pdf', 1726128, '2026-05-22 08:21:37');

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

--
-- Table structure for table `students`
--

CREATE TABLE `students` (
  `id` int(11) NOT NULL,
  `nis` varchar(50) DEFAULT NULL,
  `name` varchar(100) NOT NULL,
  `class_id` int(11) DEFAULT NULL,
  `unit` varchar(50) DEFAULT NULL,
  `status` enum('Aktif','Pindah','Keluar','Lulus') DEFAULT 'Aktif'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `students`
--

INSERT INTO `students` (`id`, `nis`, `name`, `class_id`, `unit`, `status`) VALUES
(49, '202500400', 'Ahmad Hud Nufail', 14, 'Kelompok Bermain', 'Aktif'),
(50, '202500401', 'Ainun Sumayyah althafillah', 14, 'Kelompok Bermain', 'Aktif'),
(51, '202500403', 'Andi Zea Nafeeza Kamir', 14, 'Kelompok Bermain', 'Aktif'),
(52, '202500405', 'Annayra Zaina Mufida', 14, 'Kelompok Bermain', 'Aktif'),
(53, '202400358', 'Abbas Bagis', 15, 'Kelompok Bermain', 'Aktif'),
(54, '202400388', 'Abbas Urwatul Wutsqo', 15, 'Kelompok Bermain', 'Aktif'),
(55, '202500402', 'Aisyah Rumaisha Ardhika', 15, 'Kelompok Bermain', 'Aktif'),
(56, '202400360', 'Alesha Naira Khairani', 15, 'Kelompok Bermain', 'Aktif'),
(57, '202511129', 'Adam Fathee Karim', 16, 'Raudhatul Athfal', 'Aktif'),
(58, '202511147', 'Afthar mannaf alfarezel', 16, 'Raudhatul Athfal', 'Aktif'),
(59, '202311106', 'Ainun Ahza Rumaisa Syafiqa Gumelar', 16, 'Raudhatul Athfal', 'Aktif'),
(60, '202511137', 'Aldebaran Afraz Abdillah', 16, 'Raudhatul Athfal', 'Aktif'),
(61, '202311096', 'Aleesya Nadia Rusdiansyah', 16, 'Raudhatul Athfal', 'Aktif'),
(62, '202411088', 'Abidzar Hajid Al Arsyad', 17, 'Raudhatul Athfal', 'Aktif'),
(63, '202411046', 'Aidilla Aazkya Maulana', 17, 'Raudhatul Athfal', 'Aktif'),
(64, '202411063', 'Ali Ameer Abdullah', 17, 'Raudhatul Athfal', 'Aktif'),
(65, '2023101001', 'Dzaky Uwais', 17, 'Raudhatul Athfal', 'Aktif'),
(66, '202411050', 'Eshal Humaira Shanum', 17, 'Raudhatul Athfal', 'Aktif'),
(67, '202521162', 'Abdul Aziz', 18, 'Madrasah Ibtidaiyah', 'Aktif'),
(68, '202521163', 'Abizard Mannaf Wicaksono', 18, 'Madrasah Ibtidaiyah', 'Aktif'),
(69, '202521164', 'Adiva Arsi Alya', 18, 'Madrasah Ibtidaiyah', 'Aktif'),
(70, '202521165', 'Ahmad Rifqi Khairan', 18, 'Madrasah Ibtidaiyah', 'Aktif'),
(71, '202521166', 'Ahva Shaqila Nissa', 18, 'Madrasah Ibtidaiyah', 'Aktif'),
(72, '202521188', 'Aishwarya Priyanka Wibowo', 19, 'Madrasah Ibtidaiyah', 'Aktif'),
(73, '202521189', 'Althafandra Fatih Hudzaifah', 19, 'Madrasah Ibtidaiyah', 'Aktif'),
(74, '202521190', 'Alyssa Putri Hidayat', 19, 'Madrasah Ibtidaiyah', 'Aktif'),
(75, '202521247', 'Anies Abdurrahman', 19, 'Madrasah Ibtidaiyah', 'Aktif'),
(76, '202521191', 'Aquinsha Yasmine Naladipa', 19, 'Madrasah Ibtidaiyah', 'Aktif'),
(77, '202430873', 'Adelia Mahestri Handayani', 20, 'Madrasah Tsanawiyah', 'Aktif'),
(78, '202430881', 'Andro Pandora', 20, 'Madrasah Tsanawiyah', 'Aktif'),
(79, '202430882', 'Annisa Putri Purnomo', 20, 'Madrasah Tsanawiyah', 'Aktif'),
(80, '202430884', 'Arnisyah Kamila', 20, 'Madrasah Tsanawiyah', 'Aktif'),
(81, '202430889', 'Azzahra Noorul Ibrahim', 20, 'Madrasah Tsanawiyah', 'Aktif'),
(82, '202430892', 'Dimitri Daanish Suryadhi', 20, 'Madrasah Tsanawiyah', 'Aktif'),
(83, '202330807', 'Abdullah Rahmat Usman', 21, 'Madrasah Tsanawiyah', 'Aktif'),
(84, '202330811', 'Akbar Algani', 21, 'Madrasah Tsanawiyah', 'Aktif'),
(85, '202330815', 'Ali Imron Kamil', 21, 'Madrasah Tsanawiyah', 'Aktif'),
(86, '202330818', 'Athilla Risyad Ramadhan', 21, 'Madrasah Tsanawiyah', 'Aktif'),
(87, '202330821', 'Fairuz Putra Aditya', 21, 'Madrasah Tsanawiyah', 'Aktif'),
(88, '202330823', 'Fathia Malika Kurniawan', 21, 'Madrasah Tsanawiyah', 'Aktif'),
(93, '202540566', 'Aidil Shafiq Nurhasan', 24, 'Madrasah Aliyah', 'Aktif'),
(94, '202540543', 'Aisyera Najma Walefa', 24, 'Madrasah Aliyah', 'Aktif'),
(95, '202540561', 'Anisah Zalwatulzannah', 24, 'Madrasah Aliyah', 'Aktif'),
(96, '202540579', 'Arsyad Nuhsani Putra', 24, 'Madrasah Aliyah', 'Aktif');

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

--
-- Table structure for table `supervisions`
--

CREATE TABLE `supervisions` (
  `id` int(11) NOT NULL,
  `teacher_id` int(11) DEFAULT NULL,
  `supervisor_id` int(11) DEFAULT NULL,
  `schedule_date` date DEFAULT NULL,
  `schedule_time` time DEFAULT NULL,
  `class_id` int(11) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `status` enum('Scheduled','Completed','Cancelled') DEFAULT 'Scheduled',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `supervisions`
--

INSERT INTO `supervisions` (`id`, `teacher_id`, `supervisor_id`, `schedule_date`, `schedule_time`, `class_id`, `notes`, `status`, `created_at`) VALUES
(4, 5, 6, '2026-05-25', '08:00:00', 16, '', 'Scheduled', '2026-05-25 08:09:52');

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

--
-- Table structure for table `supervisi_instrumen`
--

CREATE TABLE `supervisi_instrumen` (
  `id` int(11) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `original_name` varchar(255) NOT NULL,
  `upload_date` datetime NOT NULL,
  `uploaded_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `supervisi_instrumen`
--

INSERT INTO `supervisi_instrumen` (`id`, `file_name`, `original_name`, `upload_date`, `uploaded_by`) VALUES
(1, '1777342715_F 024-KPM FORMULIR PERMINTAAN TINDAKAN PERBAIKAN DAN PENCEGAHAN.doc', 'F 024-KPM FORMULIR PERMINTAAN TINDAKAN PERBAIKAN DAN PENCEGAHAN.doc', '2026-04-28 04:18:35', 3),
(2, '1777342742_F 025-KPM FORMULIR MONITORING TINDAKAN PERBAIKAN DAN PENCEGAHAN.doc', 'F 025-KPM FORMULIR MONITORING TINDAKAN PERBAIKAN DAN PENCEGAHAN.doc', '2026-04-28 04:19:02', 3),
(3, '1777342877_F 037-KM FORMULIR INSTRUMEN PELAKSANAAN SUPERVISI AKADEMIK .docx', 'F 037-KM FORMULIR INSTRUMEN PELAKSANAAN SUPERVISI AKADEMIK .docx', '2026-04-28 04:21:17', 3),
(4, '1777342903_F 038-KM FORMULIR WAWANCARA PASCA SUPERVISI AKADEMIK .docx', 'F 038-KM FORMULIR WAWANCARA PASCA SUPERVISI AKADEMIK .docx', '2026-04-28 04:21:43', 3);

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

--
-- Table structure for table `teaching_journals`
--

CREATE TABLE `teaching_journals` (
  `id` int(11) NOT NULL,
  `teacher_id` int(11) DEFAULT NULL,
  `class_id` int(11) DEFAULT NULL,
  `subject` varchar(100) DEFAULT NULL,
  `jenis_materi` varchar(100) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `jam_ke` varchar(10) DEFAULT NULL,
  `material` text DEFAULT NULL,
  `link_url` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `keterangan_target` varchar(100) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `name`) VALUES
(7, 'Istiqlal Boarding School'),
(2, 'Kelompok Bermain'),
(6, 'Madrasah Aliyah'),
(4, 'Madrasah Ibtidaiyah'),
(5, 'Madrasah Tsanawiyah'),
(1, 'MIJ'),
(3, 'Raudhatul Athfal');

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `full_name` varchar(100) NOT NULL,
  `role` enum('Super Admin','Pimpinan','Kepala','Guru') NOT NULL,
  `unit` varchar(50) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`, `full_name`, `role`, `unit`, `created_at`) VALUES
(1, 'superadmin', '0192023a7bbd73250516f069df18b500', 'Super Admin', 'Super Admin', 'MIJ', '2026-04-14 06:53:23'),
(2, 'pimpinan1', '9c1d2a473de9bbf38f4f51a587aa3182', 'Pimpinan Utama', 'Pimpinan', 'MIJ', '2026-04-14 06:53:23'),
(3, 'kepala_mi', '836b1f7f9b7f9bf98f1f645302defc59', 'Kepala MI', 'Kepala', 'Madrasah Ibtidaiyah', '2026-04-14 06:53:23'),
(4, 'guru_mi', '9310f83135f238b04af729fec041cca8', 'Ahmad Guru', 'Guru', 'Madrasah Ibtidaiyah', '2026-04-14 06:53:23'),
(5, 'titin_ra', 'e10adc3949ba59abbe56e057f20f883e', 'Titin Sumarnih', 'Guru', 'Raudhatul Athfal', '2026-04-17 01:21:00'),
(6, 'kepala_ra', '836b1f7f9b7f9bf98f1f645302defc59', 'Nuryanti', 'Kepala', 'Raudhatul Athfal', '2026-04-17 07:26:01'),
(7, 'kepala_mts', '836b1f7f9b7f9bf98f1f645302defc59', 'Syahril', 'Kepala', 'Madrasah Tsanawiyah', '2026-05-25 07:50:40');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `attendance`
--
ALTER TABLE `attendance`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_id` (`class_id`),
  ADD KEY `teacher_id` (`teacher_id`);

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

--
-- Indexes for table `grades`
--
ALTER TABLE `grades`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_id` (`class_id`),
  ADD KEY `teacher_id` (`teacher_id`);

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

--
-- Indexes for table `students`
--
ALTER TABLE `students`
  ADD PRIMARY KEY (`id`),
  ADD KEY `class_id` (`class_id`);

--
-- Indexes for table `supervisions`
--
ALTER TABLE `supervisions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `teacher_id` (`teacher_id`),
  ADD KEY `supervisor_id` (`supervisor_id`),
  ADD KEY `class_id` (`class_id`);

--
-- Indexes for table `supervisi_instrumen`
--
ALTER TABLE `supervisi_instrumen`
  ADD PRIMARY KEY (`id`),
  ADD KEY `uploaded_by` (`uploaded_by`);

--
-- Indexes for table `teaching_journals`
--
ALTER TABLE `teaching_journals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `teacher_id` (`teacher_id`),
  ADD KEY `class_id` (`class_id`);

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

--
-- AUTO_INCREMENT for table `grades`
--
ALTER TABLE `grades`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `attendance`
--
ALTER TABLE `attendance`
  ADD CONSTRAINT `attendance_ibfk_1` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`),
  ADD CONSTRAINT `attendance_ibfk_2` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`),
  ADD CONSTRAINT `attendance_ibfk_3` FOREIGN KEY (`teacher_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `grades`
--
ALTER TABLE `grades`
  ADD CONSTRAINT `grades_ibfk_1` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`),
  ADD CONSTRAINT `grades_ibfk_2` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`),
  ADD CONSTRAINT `grades_ibfk_3` FOREIGN KEY (`teacher_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `students`
--
ALTER TABLE `students`
  ADD CONSTRAINT `students_ibfk_1` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`);

--
-- Constraints for table `supervisions`
--
ALTER TABLE `supervisions`
  ADD CONSTRAINT `supervisions_ibfk_1` FOREIGN KEY (`teacher_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `supervisions_ibfk_2` FOREIGN KEY (`supervisor_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `supervisions_ibfk_3` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`);

--
-- Constraints for table `supervisi_instrumen`
--
ALTER TABLE `supervisi_instrumen`
  ADD CONSTRAINT `supervisi_instrumen_ibfk_1` FOREIGN KEY (`uploaded_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `teaching_journals`
--
ALTER TABLE `teaching_journals`
  ADD CONSTRAINT `teaching_journals_ibfk_1` FOREIGN KEY (`teacher_id`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `teaching_journals_ibfk_2` FOREIGN KEY (`class_id`) REFERENCES `classes` (`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 */;
