Fixed migration order

This commit is contained in:
Jonas Winkler 2018-12-12 13:13:21 +01:00
parent cccd183c31
commit 4b20d5d4b9
2 changed files with 9 additions and 3 deletions

View File

@ -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)
]

View File

@ -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 = [