Merge pull request #20 from josephschorr/fix-alembic-no-migration

Fix the alembic version returned if there is no active data migration
This commit is contained in:
Joseph Schorr 2019-11-15 13:29:02 -06:00 committed by GitHub
commit 23c5120790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,9 @@ else:
elif v3_upgrade_mode == 'production-transition':
print '481623ba00ba'
elif v3_upgrade_mode == 'post-oci-rollout' or v3_upgrade_mode == 'post-oci-roll-back-compat' or v3_upgrade_mode == 'complete':
print ActiveDataMigration.alembic_migration_revision
if ActiveDataMigration is not None:
print ActiveDataMigration.alembic_migration_revision
else:
print 'head'
else:
raise Exception('Unknown V3_UPGRADE_MODE: %s' % v3_upgrade_mode)