@@ -48,8 +48,8 @@ This project uses famous football coaches as release codenames, following an A-Z
4848 configured for async execution with ` render_as_batch=True ` (SQLite/PostgreSQL
4949 compatible); three migrations: ` 001 ` creates the ` players ` table, ` 002 ` seeds
5050 11 Starting XI players, ` 003 ` seeds 15 Substitute players (all with
51- deterministic UUID v5 values); ` alembic upgrade head ` runs automatically on
52- app startup via the lifespan handler (#2 )
51+ deterministic UUID v5 values); ` alembic upgrade head ` applied by
52+ ` entrypoint.sh ` (Docker) or manually for local development (#2 )
5353- ` alembic==1.18.4 ` , ` asyncpg==0.31.0 ` added to dependencies (#2 )
5454- ` tests/test_migrations.py ` : integration tests for migration downgrade paths —
5555 verifies each step removes only its seeded rows and restores correctly (#2 )
@@ -64,15 +64,18 @@ This project uses famous football coaches as release codenames, following an A-Z
6464
6565### Changed
6666
67- - ` databases/player_database.py ` : engine URL now reads ` DATABASE_URL `
68- environment variable (SQLite default, PostgreSQL compatible); ` connect_args `
69- made conditional on SQLite dialect (#2 )
70- - ` main.py ` : lifespan handler now applies Alembic migrations on startup via
71- thread executor (#2 )
67+ - ` databases/player_database.py ` : extracted ` get_database_url() ` helper
68+ (reads ` DATABASE_URL ` , falls back to ` STORAGE_PATH ` , SQLite default);
69+ ` connect_args ` made conditional on SQLite dialect (#2 )
70+ - ` alembic/env.py ` : removed duplicated DATABASE_URL construction; now calls
71+ ` get_database_url() ` from ` databases.player_database ` (#2 )
72+ - ` main.py ` : removed ` _apply_migrations ` from lifespan — migrations are a
73+ one-shot step, not a per-process startup concern; lifespan now logs startup
74+ only (#2 )
7275- ` Dockerfile ` : removed ` COPY storage/ ./hold/ ` and its associated comment;
7376 added ` COPY alembic.ini ` and ` COPY alembic/ ` (#2 )
74- - ` scripts/entrypoint.sh ` : removed hold→volume copy and seed script logic,
75- now replaced by Alembic migrations applied at app startup (#2 )
77+ - ` scripts/entrypoint.sh ` : runs ` alembic upgrade head ` before launching the
78+ app; replaces hold→volume copy and manual seed script pattern (#2 )
7679- ` compose.yaml ` : replaced ` STORAGE_PATH ` with ` DATABASE_URL ` pointing to the
7780 SQLite volume path (#2 )
7881- ` .gitignore ` : added ` *.db ` ; ` storage/players-sqlite3.db ` removed from git
0 commit comments