Skip to content

Commit

Permalink
url
Browse files Browse the repository at this point in the history
  • Loading branch information
Erutis committed Aug 28, 2024
1 parent 959748a commit 51d710f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
# my_important_option = config.get_main_option("my_important_option")
# ... etc.

url = os.getenv("DATABASE_URL")


def run_migrations_offline() -> None:
"""Run migrations in 'offline' mode.
Expand All @@ -42,7 +44,7 @@ def run_migrations_offline() -> None:
script output.
"""
url = os.getenv("DATABASE_URL")

context.configure(
url=url,
target_metadata=target_metadata,
Expand All @@ -61,8 +63,9 @@ def run_migrations_online() -> None:
and associate a connection with the context.
"""

connectable = engine_from_config(
config.get_section(config.config_ini_section, {}),
config.get_section(config.config_ini_section, {"url": url}),
prefix="sqlalchemy.",
poolclass=pool.NullPool,
)
Expand Down

0 comments on commit 51d710f

Please sign in to comment.