Merge pull request #13218 from ic4f/dev_safeguard_vault

Prevent a future regression
This commit is contained in:
Marius van den Beek
2022-01-21 13:09:42 +01:00
committed by GitHub
@@ -22,4 +22,12 @@ def upgrade(migrate_engine):
def downgrade(migrate_engine):
meta.bind = migrate_engine
vault.drop()
# This revision is not part of 21.09, but in 22.01 it will be handled by Alembic.
# It is possible to reach a state (via upgrading/downgrading) where this table
# will have been dropped by Alembic, but SQLAlchemy Migrate (our previous
# db migrations tool) will have version 180 (which includes this table).
# Downgrading from such a state would raise an error - which this code prevents.
try:
vault.drop()
except Exception:
pass