Skip to content

Commit

Permalink
feat(#605): remove tables when removing history
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed May 5, 2023
1 parent 6ccaa77 commit 3dac952
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/common/remove_history.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
def remove_history(data):
if 'AppData' in data:
data['AppData'] = []
tables_to_be_deleted = []
for table_name in data.keys():
if table_name.endswith('_History'):
data[table_name] = []
if table_name.startswith('AppData') or table_name.endswith('_History'):
tables_to_be_deleted.append(table_name)
else:
for item in data[table_name]:
item['_v'] = 1
for table_name in tables_to_be_deleted:
del data[table_name]
return data

0 comments on commit 3dac952

Please sign in to comment.