START TRANSACTION;


--
-- Database: `kalender_pendidikan`
--
CREATE DATABASE IF NOT EXISTS `kalender_pendidikan` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
USE `kalender_pendidikan`;

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

--
-- Struktur tabel `calendar_events`
--
CREATE TABLE `calendar_events` (
  `id` bigint(20) NOT NULL,
  `event_date` date NOT NULL,
  `title` varchar(255) NOT NULL,
  `type` varchar(50) NOT NULL,
  `created_by` varchar(100) DEFAULT 'Admin',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data untuk tabel `calendar_events`
--
INSERT INTO `calendar_events` (`id`, `event_date`, `title`, `type`, `created_by`) VALUES
(1765524406306, '2026-01-10', 'Hari Gerakan Satu Juta Pohon', 'school', 'System'),
(1765524406340, '2026-01-16', 'Isra Mi\'raj Nabi Muhammad SAW', 'holiday', 'System'),
(1765524406399, '2026-02-17', 'Tahun Baru Imlek 2577', 'holiday', 'System'),
(1765524406469, '2026-03-19', 'Hari Suci Nyepi', 'holiday', 'System'),
(1765524406502, '2026-03-21', 'Hari Raya Idul Fitri 1447 H', 'holiday', 'System'),
(1765524406565, '2026-05-01', 'Hari Buruh Internasional', 'holiday', 'System'),
(1765524406604, '2026-05-14', 'Kenaikan Isa Almasih', 'holiday', 'System'),
(1765524406633, '2026-05-27', 'Libur Idul Adha 1447 H', 'holiday', 'System'),
(1765524407617, '2026-05-28', 'Libur Bersama / Potong Qurban', 'holiday', 'System'),
(1765524407649, '2026-05-29', 'Libur Bersama / Potong Qurban', 'holiday', 'System'),
(1765524407681, '2026-06-01', 'Hari Lahir Pancasila', 'holiday', 'System'),
(1765524407719, '2026-06-02', 'Remedial & Classmeeting', 'school', 'System'),
(1765524407750, '2026-06-03', 'Remedial & Classmeeting', 'school', 'System'),
(1765524407999, '2026-06-04', 'Remedial & Classmeeting', 'school', 'System'),
(1765524408031, '2026-06-05', 'Remedial & Classmeeting', 'school', 'System'),
(1765524408060, '2026-06-06', 'Remedial & Classmeeting', 'school', 'System'),
(1765524408103, '2026-06-08', 'Remedial & Classmeeting', 'school', 'System'),
(1765524408139, '2026-06-09', 'Remedial & Classmeeting', 'school', 'System'),
(1765524408176, '2026-06-10', 'Remedial & Classmeeting', 'school', 'System'),
(1765524408212, '2026-06-11', 'Remedial & Classmeeting', 'school', 'System'),
(1765524408238, '2026-06-12', 'Pengolahan Nilai / Classmeeting', 'school', 'System'),
(1765525250994, '2026-01-05', 'Awal KBM Semester Genap', 'school', 'Admin'),
(1765527049283, '2026-02-16', 'Libur Awal Ramadhan', 'holiday', 'Admin'),
(1765527067340, '2026-02-18', 'Libur Awal Ramadhan', 'holiday', 'Admin'),
(1765527072142, '2026-02-19', 'Libur Awal Ramadhan', 'holiday', 'Admin'),
(1765527076681, '2026-02-20', 'Libur Awal Ramadhan', 'holiday', 'Admin'),
(1765527118565, '2026-02-27', 'Ujicoba ASTS 2', 'exam', 'Admin'),
(1765527177217, '2026-03-02', 'ASTS 2', 'exam', 'Admin'),
(1765527205503, '2026-03-03', 'ASTS 2', 'exam', 'Admin'),
(1765527209743, '2026-03-04', 'ASTS 2', 'exam', 'Admin'),
(1765527213949, '2026-03-05', 'ASTS 2', 'exam', 'Admin'),
(1765527218716, '2026-03-06', 'ASTS 2', 'exam', 'Admin'),
(1765527249108, '2026-03-09', 'Pesantren Ramadhan', 'school', 'Admin'),
(1765527265020, '2026-03-10', 'Pesantren Ramadhan', 'school', 'Admin'),
(1765527276682, '2026-03-11', 'Pesantren Ramadhan', 'school', 'Admin'),
(1765527281107, '2026-03-12', 'Pesantren Ramadhan', 'school', 'Admin'),
(1765527285223, '2026-03-13', 'Pesantren Ramadhan', 'school', 'Admin'),
(1765527301416, '2026-03-16', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765527309301, '2026-03-17', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765528343266, '2026-03-18', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765531007863, '2026-03-20', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765531032971, '2026-03-23', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765531240463, '2026-03-24', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765531246253, '2026-03-25', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765531254223, '2026-03-26', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1765531259649, '2026-03-27', 'Libur Idul Fitri', 'holiday', 'Admin'),
(1780310916959, '2026-01-01', 'Tahun Baru Masehi 2026', 'holiday', 'Admin'),
(1780346270487, '2026-07-15', 'Hari Pertama Masuk Sekolah', 'school', 'Admin'),
(1780346270576, '2026-08-17', 'Libur HUT Kemerdekaan RI', 'holiday', 'Admin'),
(1780346270664, '2026-09-21', 'Penilaian Tengah Semester (PTS)', 'exam', 'Admin');

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

--
-- Struktur tabel `calendar_periods`
--
CREATE TABLE `calendar_periods` (
  `id` varchar(50) NOT NULL,
  `year` varchar(20) NOT NULL,
  `semester` varchar(20) NOT NULL,
  `start_year` int(11) NOT NULL,
  `start_month` int(11) NOT NULL,
  `is_active` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data untuk tabel `calendar_periods`
--
INSERT INTO `calendar_periods` (`id`, `year`, `semester`, `start_year`, `start_month`, `is_active`) VALUES
('2025-2026-ganjil', '2025/2026', 'Ganjil', 2025, 6, 0),
('2025-2026-genap', '2025/2026', 'Genap', 2026, 0, 0),
('2026-2027-ganjil', '2026/2027', 'Ganjil', 2026, 6, 0),
('2026-2027-genap', '2026/2027', 'Genap', 2027, 0, 1);

--
-- Indexes
--
ALTER TABLE `calendar_events`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `calendar_periods`
  ADD PRIMARY KEY (`id`);

COMMIT;

