Skip to content

Commit

Permalink
just... work.
Browse files Browse the repository at this point in the history
  • Loading branch information
Erutis committed Aug 28, 2024
1 parent 51d710f commit acc8230
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions migrations/env.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from logging.config import fileConfig

from sqlalchemy import engine_from_config
from sqlalchemy import pool
from sqlalchemy import pool, create_engine

from alembic import context

Expand Down Expand Up @@ -64,13 +64,9 @@ def run_migrations_online() -> None:
"""

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

with connectable.connect() as connection:
with engine.connect() as connection:
context.configure(connection=connection, target_metadata=target_metadata)

with context.begin_transaction():
Expand Down

0 comments on commit acc8230

Please sign in to comment.