feat: run Alembic migrations automatically on startup

- Added alembic==1.18.4 to requirements.txt (was missing, transitive only)
- Added run_alembic_migrations() to startup_event in app.py — runs
   before init_db() to apply all pending migrations
- Combined approach: Alembic for complex migrations first, then inline
  _ensure_*() additive safety net in init_db()
- This ensures DB schema is always up to date on container startup
  without manual intervention
This commit is contained in:
2026-05-26 18:56:29 +03:00
parent 042c87d3bf
commit c22849d5f3
2 changed files with 36 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ referencing==0.37.0
requests==2.32.5
rpds-py==0.30.0
SecretStorage==3.5.0
alembic==1.18.4
SQLAlchemy==2.0.45
starlette==0.50.0
typing-inspection==0.4.2