Skip to content

Commit

Permalink
Revert changes if ugrade|downgrade fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Sofia Sazonova committed Jul 2, 2024
1 parent ea7e48e commit c04d35f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/migrations/dataall_migrations/herder.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self):
self.last_key = key
break

def upgrade(self, target_key=None, start_key=None, downgrade_if_fails = True):
def upgrade(self, target_key=None, start_key=None, downgrade_if_fails=True):
if start_key is not None:
self.current_key = self.migration_path[start_key].next()
if self.current_key is None:
Expand Down Expand Up @@ -72,7 +72,7 @@ def upgrade(self, target_key=None, start_key=None, downgrade_if_fails = True):
logger.info('Upgrade completed')
return True

def downgrade(self, target_key=None, start_key=None, upgrade_if_fails = True):
def downgrade(self, target_key=None, start_key=None, upgrade_if_fails=True):
self.current_key = start_key if start_key is not None else self.last_key
logger.info(
f"Downgrade from {start_key if start_key is not None else 'latest'} to {target_key if target_key is not None else 'initial'}"
Expand Down

0 comments on commit c04d35f

Please sign in to comment.