All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 49s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m6s
Build and Push Docker Images / Build Integrator (push) Successful in 58s
Build and Push Docker Images / Build Kestra Init (push) Successful in 33s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 0s
The v4 migration already ran before _apply_schema_alterations() was added, so the new ofsted_inspections columns were never created. Bump to v5 so the next backend restart re-runs the migration and applies the ALTER TABLE statements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
984 B
Python
26 lines
984 B
Python
"""
|
|
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
|
|
SCHEMA_VERSION = 5
|
|
|
|
# Changelog for documentation
|
|
SCHEMA_CHANGELOG = {
|
|
1: "Initial schema with School and SchoolResult tables",
|
|
2: "Added pupil absence fields (reading, maths, gps, writing, science)",
|
|
3: "Added supplementary data tables: ofsted, parent_view, census, admissions, sen_detail, phonics, deprivation, finance; GIAS columns on schools",
|
|
4: "Added Ofsted Report Card columns to ofsted_inspections (new framework from Nov 2025)",
|
|
5: "Apply ALTER TABLE additions for RC columns missed by create_all on existing tables",
|
|
}
|