Skip to content

Commit

Permalink
Migrate archive table in chunks. Fixes #266 (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
m3nu authored Apr 22, 2019
1 parent dc9b23f commit cb99533
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vorta/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ def init_db(con):
ArchiveModel.time, ArchiveModel.duration, ArchiveModel.size]
data = [row for row in cursor.fetchall()]
with db.atomic():
ArchiveModel.insert_many(data, fields=fields).execute()
size = 1000
for i in range(0, len(data), size):
ArchiveModel.insert_many(data[i:i + size], fields=fields).execute()

_apply_schema_update(current_schema, 13)

0 comments on commit cb99533

Please sign in to comment.