Skip to content

Commit

Permalink
update create_backup function
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Apr 2, 2024
1 parent def69cb commit d82a1b3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ofscraper/db/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,12 @@ def create_backup_transition(model_id, username):
"products_model_id_constraint_added",
"messages_model_id_constraint_added",
]
if len(set(groupA+groupB).difference(set(changes))) == 0:
return
# action if 1 test passes
log.info("creating a backup before transition")
new_path = create_backup(model_id, username, "old_schema_db_backup.db")
log.info(f"transition backup created at {new_path}")
check_backup(model_id, username, new_path)
return new_path
if len(set(groupA+groupB).difference(set(changes)))>0:
log.info("creating a backup before transition")
new_path = create_backup(model_id, username, "old_schema_db_backup.db")
log.info(f"transition backup created at {new_path}")
check_backup(model_id, username, new_path)
return new_path


async def add_column_tables(model_id=None, username=None):
Expand Down

0 comments on commit d82a1b3

Please sign in to comment.