diff --git a/src/documents/migrations/1004_documenttype_slug.py b/src/documents/migrations/1004_documenttype_slug.py deleted file mode 100644 index 557aa46d5..000000000 --- a/src/documents/migrations/1004_documenttype_slug.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 2.0.8 on 2018-10-07 14:20 - -from django.db import migrations, models -from django.utils.text import slugify - - -def re_slug_all_the_things(apps, schema_editor): - """ - Rewrite all slug values to make sure they're actually slugs before we brand - them as uneditable. - """ - - DocumentType = apps.get_model("documents", "DocumentType") - - for instance in DocumentType.objects.all(): - DocumentType.objects.filter( - pk=instance.pk - ).update( - slug=slugify(instance.slug) - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ('documents', '1003_auto_20180904_1425'), - ] - - operations = [ - migrations.AlterField( - model_name='documenttype', - name='slug', - field=models.SlugField(blank=True, editable=False), - ), - migrations.RunPython(re_slug_all_the_things, migrations.RunPython.noop) - ]