Skip to content

Commit

Permalink
Changed migrations to run on less memory
Browse files Browse the repository at this point in the history
  • Loading branch information
fbanados committed Dec 10, 2024
1 parent 32bab40 commit 2c24472
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def migrate_semantic_domains(apps, schema_editor):
# For every wordform, collect the semantic domain information in the old
# format and place it where it belongs.
wordforms = Wordform.objects.all()
for wf in wordforms:
for wf in wordforms.iterator():
if wf.rw_indices:
rapidwords = [x.strip() for x in wf.rw_indices.split(";")]
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def migrate_from_linguistinfo(apps, schema_editor):
# For every wordform, collect the semantic domain information in the old
# format and place it where it belongs.
wordforms = Wordform.objects.all()
for wf in wordforms:
for wf in wordforms.iterator():
if not wf.linguist_info:
continue
if "rw_indices" in wf.linguist_info:
Expand Down

0 comments on commit 2c24472

Please sign in to comment.