feat(vacay): add manual school holiday calendars

This commit is contained in:
Maurice
2026-09-12 11:37:57 +02:00
committed by Maurice
parent 4f8605b529
commit 41b18f970c
55 changed files with 1562 additions and 34 deletions
+20
View File
@@ -4534,6 +4534,26 @@ function runMigrations(db: Database.Database): void {
db.exec('ALTER TABLE places ADD COLUMN fill_percent INTEGER');
}
},
() => {
db.exec(`
CREATE TABLE IF NOT EXISTS school_holiday_countries (
code TEXT PRIMARY KEY, name TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS school_holiday_regions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
country TEXT NOT NULL REFERENCES school_holiday_countries(code),
name TEXT NOT NULL COLLATE NOCASE, revision INTEGER NOT NULL DEFAULT 1,
UNIQUE(country, name)
);
CREATE TABLE IF NOT EXISTS school_holiday_periods (
id INTEGER PRIMARY KEY AUTOINCREMENT,
region_id INTEGER NOT NULL REFERENCES school_holiday_regions(id) ON DELETE CASCADE,
name TEXT NOT NULL, start_date TEXT NOT NULL, end_date TEXT NOT NULL,
CHECK (end_date >= start_date)
);
CREATE INDEX IF NOT EXISTS idx_school_holiday_periods_region ON school_holiday_periods(region_id);
`);
},
];
if (currentVersion < migrations.length) {