Use an explicit transaction
This commit is contained in:
parent
d8df96763c
commit
46787de9bc
1 changed files with 3 additions and 2 deletions
|
|
@ -54,8 +54,9 @@ def db_connection(request):
|
|||
db.connection = connection
|
||||
|
||||
if request.param == 'all_at_once':
|
||||
connection.execute(f'CREATE SCHEMA {config.CLEAN_SCHEMA};')
|
||||
db.Base.metadata.create_all(connection)
|
||||
with connection.begin():
|
||||
connection.execute(sa.text(f'CREATE SCHEMA {config.CLEAN_SCHEMA};'))
|
||||
db.Base.metadata.create_all(connection)
|
||||
else:
|
||||
cfg = migrations_config.Config('alembic.ini')
|
||||
migrations_cmd.upgrade(cfg, 'head')
|
||||
|
|
|
|||
Loading…
Reference in a new issue