Add runtime DB schema migration and version tracking

This commit is contained in:
2026-04-12 19:13:36 +02:00
parent ffe7ada469
commit 21b38365c4
3 changed files with 83 additions and 5 deletions

View File

@@ -99,6 +99,7 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
- Issue: `app/db.py` only creates missing tables on startup and has no schema version marker or migration strategy. This leaves upgrades brittle and makes it difficult to evolve the database without manual intervention.
- Propose: Add a lightweight migration system or schema version table, define incremental migration scripts, and run upgrades during startup before the application begins serving requests.
- Test: Add tests that simulate an older schema version and verify startup migrates it to the latest schema, and assert that `init_db`/migration code leaves the database in the expected current state.
- Status: completed
14. Split the monolithic config router into focused sub-routers
- Goal: Improve maintainability, reduce cognitive load, and make HTTP routing responsibilities easier to isolate and test.