@@ -50,7 +50,9 @@ class FixtureMigration(declarative_base):
50
50
bind : Mapped [str ] = mapped_column (String (), primary_key = True )
51
51
module_name : Mapped [str ] = mapped_column (String (), primary_key = True )
52
52
signature : Mapped [str ] = mapped_column (String (), nullable = False )
53
- alembic_revision : Mapped [str ] = mapped_column (String (), nullable = True , default = str (context .get_head_revision ()))
53
+ alembic_head_revisions : Mapped [str ] = mapped_column (
54
+ String (), nullable = True , default = str (context .get_head_revision ())
55
+ )
54
56
55
57
processed_at : Mapped [datetime ] = mapped_column (
56
58
DateTime (), nullable = False , default = datetime .now
@@ -260,9 +262,10 @@ async def a_migrate_fixtures(
260
262
cls .logger .info (
261
263
f"`{ fixture_module .__name__ } ` fixtures correctly created for `{ bind_name } ` bind"
262
264
)
263
- except Exception as e :
265
+ except Exception :
264
266
cls .logger .error (
265
- f"`{ fixture_module .__name__ } ` fixtures failed to apply to `{ bind_name } ` bind" , exc_info = True
267
+ f"`{ fixture_module .__name__ } ` fixtures failed to apply to `{ bind_name } ` bind" ,
268
+ exc_info = True ,
266
269
)
267
270
await session .rollback ()
268
271
@@ -397,8 +400,10 @@ async def run_migrations_online() -> None:
397
400
for name , rec in engines .items ():
398
401
logger .info (f"Migrating database { name } " )
399
402
if isinstance (rec ["engine" ], AsyncEngine ):
403
+
400
404
def migration_callable (* args , ** kwargs ):
401
405
return do_run_migration (* args , name = name , ** kwargs )
406
+
402
407
await rec ["connection" ].run_sync (migration_callable )
403
408
else :
404
409
do_run_migration (rec ["connection" ], name )
@@ -420,7 +425,8 @@ def migration_callable(*args, **kwargs):
420
425
for name , rec in engines .items ():
421
426
if isinstance (rec ["engine" ], AsyncEngine ):
422
427
await FixtureHandler .a_migrate_fixtures (
423
- bind_name = name , session = async_sessionmaker (bind = rec ["connection" ])
428
+ bind_name = name ,
429
+ session = async_sessionmaker (bind = rec ["connection" ]),
424
430
)
425
431
else :
426
432
FixtureHandler .migrate_fixtures (
0 commit comments