fix(migrations): harden BAT-025 PostgreSQL verification
This commit is contained in:
+3
-2
@@ -10,13 +10,14 @@ from app.core.config import get_settings
|
||||
config = context.config
|
||||
|
||||
if config.config_file_name is not None:
|
||||
fileConfig(config.config_file_name)
|
||||
# Alembic may run in-process (bootstrap/tests); preserve application loggers.
|
||||
fileConfig(config.config_file_name, disable_existing_loggers=False)
|
||||
|
||||
target_metadata = None
|
||||
|
||||
|
||||
def _configure_database_url() -> str:
|
||||
settings = get_settings()
|
||||
settings = config.attributes.get("portfoliohub_settings") or get_settings()
|
||||
database_url = settings.active_database_url
|
||||
config.set_main_option("sqlalchemy.url", database_url.replace("%", "%%"))
|
||||
return database_url
|
||||
|
||||
Reference in New Issue
Block a user