Skip to content

Commit 033f243

Browse files
committed
alembic env.py
1 parent 4b87ab4 commit 033f243

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

api_v1/tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import asyncio
32
import httpx
43
import pytest_asyncio

async_alembic/env.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,22 @@ def run_migrations_offline() -> None:
5959

6060

6161
def do_run_migrations(connection: Connection) -> None:
62-
context.configure(connection=connection, target_metadata=target_metadata)
63-
62+
context.configure(
63+
connection=connection,
64+
target_metadata=target_metadata,
65+
compare_type=True,
66+
)
6467
with context.begin_transaction():
6568
context.run_migrations()
6669

6770

68-
async def run_async_migrations() -> None:
71+
async def run_async_migrations(connectable) -> None:
6972
"""In this scenario we need to create an Engine
7073
and associate a connection with the context.
7174
7275
"""
73-
74-
connectable = async_engine_from_config(
75-
config.get_section(config.config_ini_section, {}),
76-
prefix="sqlalchemy.",
77-
poolclass=pool.NullPool,
78-
)
79-
8076
async with connectable.connect() as connection:
8177
await connection.run_sync(do_run_migrations)
82-
8378
await connectable.dispose()
8479

8580

0 commit comments

Comments
 (0)