db: Enable batch migrations by default

These are compatible with SQLite.

Change-Id: Id56b5758f9c1caa664c4a983726d85b3b15e9c04
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2023-07-19 10:17:57 +01:00 committed by Stephen Finucane
parent 9b9afcaa29
commit abddf333ad
1 changed files with 7 additions and 3 deletions

View File

@ -48,11 +48,14 @@ def run_migrations_offline():
Calls to context.execute() here emit the given string to the
script output.
"""
url = CONF.database.connection
context.configure(
url=url, target_metadata=target_metadata, literal_binds=True)
url=url,
render_as_batch=True,
target_metadata=target_metadata,
literal_binds=True,
)
with context.begin_transaction():
context.run_migrations()
@ -70,7 +73,8 @@ def run_migrations_online():
with engine.connect() as connection:
context.configure(
connection=connection,
target_metadata=target_metadata
target_metadata=target_metadata,
render_as_batch=True,
)
with context.begin_transaction():