Skip to content

Commit

Permalink
Merge pull request #131 from smartin015/migration
Browse files Browse the repository at this point in the history
Fix DB 0.0.3 migration script
  • Loading branch information
smartin015 authored Oct 15, 2022
2 parents 044123f + b926cd4 commit 776f8d6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions continuousprint/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,20 @@ class TempSet(Set):

if logger is not None:
logger.warning(
f"Beginning migration to v0.0.3 - {Set.select().count()} sets to migrate"
f"Beginning migration to v0.0.3 for decoupled completions - {Set.select().count()} sets to migrate"
)
with db.atomic():
TempSet.create_table(safe=True)
for s in Set.select().execute():
for s in Set.select(
Set.path,
Set.sd,
Set.job,
Set.rank,
Set.count,
Set.remaining,
Set.material_keys,
Set.profile_keys,
).execute():
attrs = {}
for f in Set._meta.sorted_field_names:
attrs[f] = getattr(s, f)
Expand Down

0 comments on commit 776f8d6

Please sign in to comment.