From 0f9d83a233115c7ce34d30e4186e2a560b8d998c Mon Sep 17 00:00:00 2001 From: mohamad Date: Sun, 1 Jun 2025 17:39:07 +0200 Subject: [PATCH] refactor: Update migration functions to accept connection parameter for improved flexibility and consistency --- be/alembic/migrations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/be/alembic/migrations.py b/be/alembic/migrations.py index f943597..9bfc5d0 100644 --- a/be/alembic/migrations.py +++ b/be/alembic/migrations.py @@ -26,9 +26,9 @@ async def run_migrations(): async with engine.connect() as connection: # Get current database schema version - def do_get_current_rev(): + def do_get_current_rev(conn): migration_context = MigrationContext.configure( - connection, + conn, opts={ 'target_metadata': DatabaseBase.metadata, 'compare_type': True, @@ -40,9 +40,9 @@ async def run_migrations(): current_rev = await connection.run_sync(do_get_current_rev) # Run migrations - def do_upgrade(): + def do_upgrade(conn): migration_context = MigrationContext.configure( - connection, + conn, opts={ 'target_metadata': DatabaseBase.metadata, 'compare_type': True, -- 2.45.2