From 4b20d5d4b9afba9a68b69a9867530e42fc8c2833 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Wed, 12 Dec 2018 13:13:21 +0100 Subject: [PATCH] Fixed migration order --- src/documents/migrations/0022_auto_20181007_1420.py | 10 ++++++++-- src/documents/migrations/1001_workflow_improvements.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/documents/migrations/0022_auto_20181007_1420.py b/src/documents/migrations/0022_auto_20181007_1420.py index 2853f2093..e8230a741 100644 --- a/src/documents/migrations/0022_auto_20181007_1420.py +++ b/src/documents/migrations/0022_auto_20181007_1420.py @@ -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 @@ -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 = [ @@ -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) ] diff --git a/src/documents/migrations/1001_workflow_improvements.py b/src/documents/migrations/1001_workflow_improvements.py index d0e5158db..20820c32c 100755 --- a/src/documents/migrations/1001_workflow_improvements.py +++ b/src/documents/migrations/1001_workflow_improvements.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('documents', '0022_auto_20181007_1420'), + ('documents', '0021_document_storage_type'), ] operations = [