Adding a commit at the end of each migration file.

The assumption that a commit is issued in between migration files was false. This will force the db connection to commit, the alter table commands will complete and the alembic version updated.
This commit is contained in:
Rebecca Law
2020-05-20 16:46:02 +01:00
parent 4116affe7f
commit fa7d2c2c3f
2 changed files with 2 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ def upgrade():
""") """)
if environment not in ["live", "production"]: if environment not in ["live", "production"]:
op.execute('ALTER TABLE notification_history DROP CONSTRAINT IF EXISTS chk_notification_history_postage_null') op.execute('ALTER TABLE notification_history DROP CONSTRAINT IF EXISTS chk_notification_history_postage_null')
op.execute('COMMIT')
def downgrade(): def downgrade():

View File

@@ -38,6 +38,7 @@ def upgrade():
) )
NOT VALID NOT VALID
""") """)
op.execute('COMMIT')
def downgrade(): def downgrade():