refactor: Migrate database service to SQLModel and Alembic.

- Add SQLModel for type-safe database models
- Implement Alembic for schema migration management
- Create 7 migrations covering all existing schema changes
- Add automatic migration system that runs on startup
- Maintain backward compatibility with existing raw SQL queries
- Remove old manual migration system
- All tests pass (109 tests)

Benefits:
- Full type safety with Pydantic validation
- Version-controlled schema changes
- Automatic migration detection and application
- Better developer experience with typed models
This commit is contained in:
Elisiário Couto
2025-09-30 23:34:48 +01:00
parent 5465941058
commit dc7aed316d
18 changed files with 1030 additions and 661 deletions

1
alembic/README Normal file
View File

@@ -0,0 +1 @@
Generic single-database configuration.