mirror of
https://github.com/ansible/awx.git
synced 2026-04-30 14:15:28 -02:30
3.2.0 should not have any replacements defined unless 0005a or 0005b migrations have been run previously
This commit is contained in:
@@ -22,11 +22,14 @@ def squash_data(squashed):
|
||||
return squashed_keys, key_index
|
||||
|
||||
|
||||
def current_migration():
|
||||
def current_migration(exclude_squashed=True):
|
||||
'''Get the latest migration non-squashed migration'''
|
||||
try:
|
||||
recorder = migrations.recorder.MigrationRecorder(connection)
|
||||
return recorder.migration_qs.filter(app='main').exclude(name__contains='squashed').latest('id')
|
||||
migration_qs = recorder.migration_qs.filter(app='main')
|
||||
if exclude_squashed:
|
||||
migration_qs = migration_qs.exclude(name__contains='squashed')
|
||||
return migration_qs.latest('id')
|
||||
except (recorder.Migration.DoesNotExist, OperationalError):
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user