--
-- Host: localhost    Database: myraport
-- ------------------------------------------------------


--
-- Table structure for table `database_nilai`
--

CREATE TABLE `database_nilai` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `mata_pelajaran_id` bigint unsigned NOT NULL,
  `tingkat` enum('7','8','9') COLLATE utf8mb4_unicode_ci NOT NULL,
  `semester` enum('ganjil','genap') COLLATE utf8mb4_unicode_ci NOT NULL,
  `nilai_angka` int NOT NULL,
  `capaian_kompetensi` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `database_nilai_unique` (`mata_pelajaran_id`,`tingkat`,`semester`,`nilai_angka`),
  KEY `database_nilai_mata_pelajaran_id_index` (`mata_pelajaran_id`),
  KEY `database_nilai_mata_pelajaran_id_tingkat_semester_index` (`mata_pelajaran_id`,`tingkat`,`semester`),
  CONSTRAINT `database_nilai_mata_pelajaran_id_foreign` FOREIGN KEY (`mata_pelajaran_id`) REFERENCES `mata_pelajaran` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `database_nilai`
--


--
-- Table structure for table `ekstrakurikuler`
--

CREATE TABLE `ekstrakurikuler` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `siswa_id` bigint unsigned NOT NULL,
  `tahun_ajaran_id` bigint unsigned NOT NULL,
  `semester` enum('ganjil','genap') COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_kegiatan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nilai` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `keterangan` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ekstrakurikuler_siswa_id_foreign` (`siswa_id`),
  KEY `ekstrakurikuler_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  CONSTRAINT `ekstrakurikuler_siswa_id_foreign` FOREIGN KEY (`siswa_id`) REFERENCES `siswa` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ekstrakurikuler_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `ekstrakurikuler`
--


--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `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,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `failed_jobs`
--


--
-- Table structure for table `guru`
--

CREATE TABLE `guru` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nip` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `guru`
--


--
-- Table structure for table `job_batches`
--

CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `job_batches`
--


--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` smallint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `jobs`
--


--
-- Table structure for table `kelas`
--

CREATE TABLE `kelas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tingkat` int NOT NULL,
  `nama_rombel` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_kelas` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fase` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'D',
  `guru_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kelas_guru_id_foreign` (`guru_id`),
  CONSTRAINT `kelas_guru_id_foreign` FOREIGN KEY (`guru_id`) REFERENCES `guru` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kelas`
--


--
-- Table structure for table `madrasah`
--

CREATE TABLE `madrasah` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `alamat_jalan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kecamatan` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kota` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `provinsi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_kemenag` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_madrasah` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_kepala` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nip_kepala` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `madrasah`
--


--
-- Table structure for table `mata_pelajaran`
--

CREATE TABLE `mata_pelajaran` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `urutan` int NOT NULL DEFAULT '0',
  `is_induk` tinyint(1) NOT NULL DEFAULT '0',
  `induk_id` bigint unsigned DEFAULT NULL,
  `kelompok` enum('pai','umum','mulok') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'umum',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mata_pelajaran_induk_id_foreign` (`induk_id`),
  CONSTRAINT `mata_pelajaran_induk_id_foreign` FOREIGN KEY (`induk_id`) REFERENCES `mata_pelajaran` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `mata_pelajaran`
--

INSERT INTO `mata_pelajaran` VALUES (1,'Pendidikan Agama Islam',1,1,NULL,'pai','2026-04-25 19:31:14','2026-04-25 19:31:14'),(2,'A. Al Qur\'an Hadis',2,0,1,'pai','2026-04-25 19:31:14','2026-04-25 19:31:14'),(3,'B. Akidah Akhlak',3,0,1,'pai','2026-04-25 19:31:14','2026-04-25 19:31:14'),(4,'C. Fikih',4,0,1,'pai','2026-04-25 19:31:14','2026-04-25 19:31:14'),(5,'D. Sejarah Kebudayaan Islam',5,0,1,'pai','2026-04-25 19:31:14','2026-04-25 19:31:14'),(6,'Bahasa Arab',6,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(7,'Pendidikan Pancasila',7,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(8,'Bahasa Indonesia',8,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(9,'Matematika',9,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(10,'Ilmu Pengetahuan Alam',10,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(11,'Ilmu Pengetahuan Sosial',11,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(12,'Bahasa Inggris',12,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(13,'Pendidikan Jasmani, Olahraga dan Kesehatan',13,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(14,'Informatika',14,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(15,'Seni dan Budaya',15,0,NULL,'umum','2026-04-25 19:31:14','2026-04-25 19:31:14'),(16,'Muatan Lokal',16,1,NULL,'mulok','2026-04-25 19:31:14','2026-04-25 19:31:14'),(17,'A. Tahfidz',17,0,16,'mulok','2026-04-25 19:31:14','2026-04-25 19:31:14'),(18,'B. Nahwu Shorof',18,0,16,'mulok','2026-04-25 19:31:14','2026-04-25 19:31:14'),(19,'C. Ad\'iyah',19,0,16,'mulok','2026-04-25 19:31:14','2026-04-25 19:31:14'),(20,'D. Risalah Fiqih',20,0,16,'mulok','2026-04-25 19:31:14','2026-04-25 19:31:14'),(21,'E. Hadits',21,0,16,'mulok','2026-04-25 19:31:14','2026-04-25 19:31:14'),(22,'F. Tauhid',22,0,16,'mulok','2026-04-25 19:31:14','2026-04-25 19:31:14');

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` 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,'2025_01_01_000001_create_tahun_ajaran_table',1),(5,'2025_01_01_000002_create_madrasah_table',1),(6,'2025_01_01_000003_create_siswa_table',1),(7,'2025_01_01_000004_create_guru_table',1),(8,'2025_01_01_000005_create_kelas_table',1),(9,'2025_01_01_000006_create_siswa_kelas_table',1),(10,'2025_01_01_000007_create_mata_pelajaran_table',1),(11,'2025_01_01_000008_create_database_nilai_table',1),(12,'2025_01_01_000009_create_raport_nilai_table',1),(13,'2025_01_01_000010_create_raport_halaman2_table',1),(14,'2025_01_01_000011_create_ekstrakurikuler_table',1),(15,'2025_01_01_000012_create_prestasi_table',1),(16,'2025_01_01_000013_add_tingkat_semester_to_database_nilai_table',1),(17,'2026_04_25_130022_create_personal_access_tokens_table',1);

--
-- Table structure for table `prestasi`
--

CREATE TABLE `prestasi` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `siswa_id` bigint unsigned NOT NULL,
  `tahun_ajaran_id` bigint unsigned NOT NULL,
  `semester` enum('ganjil','genap') COLLATE utf8mb4_unicode_ci NOT NULL,
  `jenis_prestasi` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `keterangan` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `prestasi_siswa_id_foreign` (`siswa_id`),
  KEY `prestasi_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  CONSTRAINT `prestasi_siswa_id_foreign` FOREIGN KEY (`siswa_id`) REFERENCES `siswa` (`id`) ON DELETE CASCADE,
  CONSTRAINT `prestasi_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `prestasi`
--


--
-- Table structure for table `raport_halaman2`
--

CREATE TABLE `raport_halaman2` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `siswa_id` bigint unsigned NOT NULL,
  `tahun_ajaran_id` bigint unsigned NOT NULL,
  `semester` enum('ganjil','genap') COLLATE utf8mb4_unicode_ci NOT NULL,
  `kokurikuler` text COLLATE utf8mb4_unicode_ci,
  `catatan_wali` text COLLATE utf8mb4_unicode_ci,
  `absensi_sakit` int NOT NULL DEFAULT '0',
  `absensi_izin` int NOT NULL DEFAULT '0',
  `absensi_alpa` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `halaman2_unique` (`siswa_id`,`tahun_ajaran_id`,`semester`),
  KEY `raport_halaman2_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  CONSTRAINT `raport_halaman2_siswa_id_foreign` FOREIGN KEY (`siswa_id`) REFERENCES `siswa` (`id`) ON DELETE CASCADE,
  CONSTRAINT `raport_halaman2_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `raport_halaman2`
--


--
-- Table structure for table `raport_nilai`
--

CREATE TABLE `raport_nilai` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `siswa_id` bigint unsigned NOT NULL,
  `kelas_id` bigint unsigned NOT NULL,
  `tahun_ajaran_id` bigint unsigned NOT NULL,
  `semester` enum('ganjil','genap') COLLATE utf8mb4_unicode_ci NOT NULL,
  `mata_pelajaran_id` bigint unsigned NOT NULL,
  `nilai_akhir` int NOT NULL,
  `capaian_kompetensi` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `raport_nilai_unique` (`siswa_id`,`tahun_ajaran_id`,`semester`,`mata_pelajaran_id`),
  KEY `raport_nilai_kelas_id_foreign` (`kelas_id`),
  KEY `raport_nilai_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  KEY `raport_nilai_mata_pelajaran_id_foreign` (`mata_pelajaran_id`),
  KEY `raport_nilai_siswa_id_tahun_ajaran_id_semester_index` (`siswa_id`,`tahun_ajaran_id`,`semester`),
  CONSTRAINT `raport_nilai_kelas_id_foreign` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`) ON DELETE CASCADE,
  CONSTRAINT `raport_nilai_mata_pelajaran_id_foreign` FOREIGN KEY (`mata_pelajaran_id`) REFERENCES `mata_pelajaran` (`id`) ON DELETE CASCADE,
  CONSTRAINT `raport_nilai_siswa_id_foreign` FOREIGN KEY (`siswa_id`) REFERENCES `siswa` (`id`) ON DELETE CASCADE,
  CONSTRAINT `raport_nilai_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `raport_nilai`
--


--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--


--
-- Table structure for table `siswa`
--

CREATE TABLE `siswa` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nama_lengkap` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nis_madrasah` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nisn` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tempat_lahir` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tanggal_lahir` date DEFAULT NULL,
  `jenis_kelamin` enum('L','P') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agama` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status_keluarga` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `anak_ke` int DEFAULT NULL,
  `alamat` text COLLATE utf8mb4_unicode_ci,
  `no_telp` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sekolah_asal` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kelas_diterima` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tanggal_diterima` date DEFAULT NULL,
  `nama_ayah` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_ibu` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alamat_ortu` text COLLATE utf8mb4_unicode_ci,
  `pekerjaan_ayah` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pekerjaan_ibu` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_wali` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pekerjaan_wali` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alamat_wali` text COLLATE utf8mb4_unicode_ci,
  `foto` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `siswa`
--


--
-- Table structure for table `siswa_kelas`
--

CREATE TABLE `siswa_kelas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `siswa_id` bigint unsigned NOT NULL,
  `kelas_id` bigint unsigned NOT NULL,
  `tahun_ajaran_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `siswa_kelas_siswa_id_tahun_ajaran_id_unique` (`siswa_id`,`tahun_ajaran_id`),
  KEY `siswa_kelas_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  KEY `siswa_kelas_kelas_id_tahun_ajaran_id_index` (`kelas_id`,`tahun_ajaran_id`),
  CONSTRAINT `siswa_kelas_kelas_id_foreign` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`) ON DELETE CASCADE,
  CONSTRAINT `siswa_kelas_siswa_id_foreign` FOREIGN KEY (`siswa_id`) REFERENCES `siswa` (`id`) ON DELETE CASCADE,
  CONSTRAINT `siswa_kelas_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `siswa_kelas`
--


--
-- Table structure for table `tahun_ajaran`
--

CREATE TABLE `tahun_ajaran` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `semester_ganjil` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Ganjil',
  `semester_genap` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Genap',
  `tanggal_raport_ganjil` date DEFAULT NULL,
  `tanggal_raport_genap` date DEFAULT NULL,
  `is_aktif` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tahun_ajaran`
--



