batch mode as default for alembic

This commit is contained in:
2026-07-22 09:24:13 +02:00
parent 7bfbdc731b
commit 9392f3fc77
+6 -1
View File
@@ -46,6 +46,7 @@ def run_migrations_offline() -> None:
target_metadata=target_metadata, target_metadata=target_metadata,
literal_binds=True, literal_binds=True,
dialect_opts={"paramstyle": "named"}, dialect_opts={"paramstyle": "named"},
render_as_batch=True,
) )
with context.begin_transaction(): with context.begin_transaction():
@@ -66,7 +67,11 @@ def run_migrations_online() -> None:
) )
with connectable.connect() as connection: with connectable.connect() as connection:
context.configure(connection=connection, target_metadata=target_metadata) context.configure(
connection=connection,
target_metadata=target_metadata,
render_as_batch=True,
)
with context.begin_transaction(): with context.begin_transaction():
context.run_migrations() context.run_migrations()