diff options
Diffstat (limited to 'alembic/env.py')
| -rw-r--r-- | alembic/env.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/alembic/env.py b/alembic/env.py index 6fcbeb0..90f262b 100644 --- a/alembic/env.py +++ b/alembic/env.py @@ -1,6 +1,7 @@ from __future__ import annotations from logging.config import fileConfig +import os from alembic import context from sqlalchemy import engine_from_config, pool @@ -18,6 +19,10 @@ target_metadata = Base.metadata def get_database_url() -> str: + env_database_url = os.getenv("DATABASE_URL") + if env_database_url: + return env_database_url + configured_url = config.get_main_option("sqlalchemy.url") if configured_url: return configured_url |
