8 Commits

Author SHA1 Message Date
Tudor
f4919db3b9 Add automatic schema versioning with startup migration
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 57s
On startup, the app now checks if the database schema version matches
the code. If there's a mismatch or no version exists, it automatically
runs a full data migration before starting.

- Add backend/version.py with SCHEMA_VERSION constant
- Add backend/migration.py with extracted migration logic
- Add SchemaVersion model to track DB version
- Add version check functions to database.py
- Update app.py lifespan to use check_and_migrate_if_needed()
- Simplify migrate_csv_to_db.py to use shared logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 10:23:02 +00:00
Tudor Sitaru
e822513e03 Fix missing import for Base and engine in migration script
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 56s
2026-01-06 22:34:47 +00:00
Tudor Sitaru
409853e82e Fix syntax error - remove duplicate code at end of migration script
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 55s
2026-01-06 22:31:57 +00:00
Tudor Sitaru
e2b2ddfb66 Fix migration script to handle percentage signs in CSV data
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 55s
- Updated parse_numeric() to strip percentage signs before parsing
- This fixes the issue where all percentage metrics were showing as NULL/empty
- School cards will now display actual performance data after re-running migration
2026-01-06 22:22:33 +00:00
Tudor Sitaru
35e661d732 fixing migration script
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 55s
2026-01-06 21:12:47 +00:00
Tudor Sitaru
822feaf494 fixing migration script
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 56s
2026-01-06 21:01:49 +00:00
Tudor Sitaru
491302d409 fixing migration script
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 57s
2026-01-06 20:56:09 +00:00
Tudor Sitaru
5efc4c6af0 database addition 2026-01-06 17:22:26 +00:00