Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Fixed migration order
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Winkler committed Dec 12, 2018
1 parent cccd183 commit 4b20d5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/documents/migrations/0022_auto_20181007_1420.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def re_slug_all_the_things(apps, schema_editor):

Tag = apps.get_model("documents", "Tag")
Correspondent = apps.get_model("documents", "Correspondent")
DocumentType = apps.get_model("documents", "DocumentType")

for klass in (Tag, Correspondent):
for klass in (Tag, Correspondent, DocumentType):
for instance in klass.objects.all():
klass.objects.filter(
pk=instance.pk
Expand All @@ -25,7 +26,7 @@ def re_slug_all_the_things(apps, schema_editor):
class Migration(migrations.Migration):

dependencies = [
('documents', '0021_document_storage_type'),
('documents', '1003_auto_20180904_1425'),
]

operations = [
Expand All @@ -48,5 +49,10 @@ class Migration(migrations.Migration):
name='slug',
field=models.SlugField(blank=True, editable=False),
),
migrations.AlterField(
model_name='documenttype',
name='slug',
field=models.SlugField(blank=True, editable=False),
),
migrations.RunPython(re_slug_all_the_things, migrations.RunPython.noop)
]
2 changes: 1 addition & 1 deletion src/documents/migrations/1001_workflow_improvements.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
('documents', '0022_auto_20181007_1420'),
('documents', '0021_document_storage_type'),
]

operations = [
Expand Down

0 comments on commit 4b20d5d

Please sign in to comment.