2026-01-16 10:23:02 +00:00
|
|
|
"""
|
|
|
|
|
Schema versioning for database migrations.
|
|
|
|
|
|
|
|
|
|
HOW TO USE:
|
|
|
|
|
- Bump SCHEMA_VERSION when making changes to database models
|
|
|
|
|
- This triggers an automatic full data reimport on next app startup
|
|
|
|
|
|
|
|
|
|
WHEN TO BUMP:
|
|
|
|
|
- Adding/removing columns in models.py
|
|
|
|
|
- Changing column types or constraints
|
|
|
|
|
- Modifying CSV column mappings in schemas.py
|
|
|
|
|
- Any change that requires fresh data import
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
# Current schema version - increment when models change
|
2026-03-25 14:41:15 +00:00
|
|
|
SCHEMA_VERSION = 5
|
2026-01-16 10:23:02 +00:00
|
|
|
|
|
|
|
|
# Changelog for documentation
|
|
|
|
|
SCHEMA_CHANGELOG = {
|
|
|
|
|
1: "Initial schema with School and SchoolResult tables",
|
|
|
|
|
2: "Added pupil absence fields (reading, maths, gps, writing, science)",
|
2026-03-24 11:44:04 +00:00
|
|
|
3: "Added supplementary data tables: ofsted, parent_view, census, admissions, sen_detail, phonics, deprivation, finance; GIAS columns on schools",
|
2026-03-25 13:03:04 +00:00
|
|
|
4: "Added Ofsted Report Card columns to ofsted_inspections (new framework from Nov 2025)",
|
2026-03-25 14:41:15 +00:00
|
|
|
5: "Apply ALTER TABLE additions for RC columns missed by create_all on existing tables",
|
2026-01-16 10:23:02 +00:00
|
|
|
}
|