Set migrations to render in batch mode
This commit is contained in:
1 parent
33695a51a3
commit
2089ce953e
2 files changed
+5
-2
No files matched your search
+5
-2
@@ -9,7 +9,7 @@ from sqlalchemy import pool
|
||||
|
||||
from alembic import context
|
||||
|
||||
from data.database import Base
|
||||
from data.database import Base, PowerballDraw
|
||||
|
||||
sys.path.append(os.getcwd())
|
||||
load_dotenv()
|
||||
@@ -57,6 +57,7 @@ def run_migrations_offline() -> None:
|
||||
target_metadata=target_metadata,
|
||||
literal_binds=True,
|
||||
dialect_opts={"paramstyle": "named"},
|
||||
render_as_batch=True,
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
@@ -78,7 +79,9 @@ def run_migrations_online() -> None:
|
||||
|
||||
with connectable.connect() as connection:
|
||||
context.configure(
|
||||
connection=connection, target_metadata=target_metadata
|
||||
connection=connection,
|
||||
target_metadata=target_metadata,
|
||||
render_as_batch=True,
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
|
||||
Reference in new issue
Block a user