test(postgres): allow Testcontainers to override the migration sqlalchemy.url
alembic/env.py previously always overwrote sqlalchemy.url from Settings().postgres.dsn, which made it impossible for a test fixture to point Alembic at a Testcontainers-managed database. Now env.py only sets it when unset, and a new integration suite runs `alembic upgrade head` against a real Postgres container per ADR-0016 (no create_all()).
This commit is contained in:
@@ -84,9 +84,9 @@ path_separator = os
|
||||
# output_encoding = utf-8
|
||||
|
||||
# database URL. This is consumed by the user-maintained env.py script only.
|
||||
# other means of configuring database URLs may be customized within the env.py
|
||||
# file.
|
||||
sqlalchemy.url = driver://user:pass@localhost/dbname
|
||||
# Left unset here: env.py falls back to Settings().postgres.dsn (ADR-0009),
|
||||
# and test fixtures may override it programmatically before invoking Alembic.
|
||||
# sqlalchemy.url =
|
||||
|
||||
|
||||
[post_write_hooks]
|
||||
|
||||
Reference in New Issue
Block a user