From 569178025cd7ca62f0a52949572edd124edca377 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Fri, 19 Feb 2016 12:38:53 +0000 Subject: [PATCH] Add missing on_delete parameters to migrations --- .../migrations/0026_group_collection_permission.py | 6 +++--- wagtail/wagtaildocs/migrations/0005_document_collection.py | 2 +- wagtail/wagtailimages/migrations/0011_image_collection.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wagtail/wagtailcore/migrations/0026_group_collection_permission.py b/wagtail/wagtailcore/migrations/0026_group_collection_permission.py index d657be6d02..dee6962c2f 100644 --- a/wagtail/wagtailcore/migrations/0026_group_collection_permission.py +++ b/wagtail/wagtailcore/migrations/0026_group_collection_permission.py @@ -16,9 +16,9 @@ class Migration(migrations.Migration): name='GroupCollectionPermission', fields=[ ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('collection', models.ForeignKey(related_name='group_permissions', verbose_name='collection', to='wagtailcore.Collection')), - ('group', models.ForeignKey(related_name='collection_permissions', verbose_name='group', to='auth.Group')), - ('permission', models.ForeignKey(to='auth.Permission', verbose_name='permission')), + ('collection', models.ForeignKey(related_name='group_permissions', verbose_name='collection', to='wagtailcore.Collection', on_delete=models.CASCADE)), + ('group', models.ForeignKey(related_name='collection_permissions', verbose_name='group', to='auth.Group', on_delete=models.CASCADE)), + ('permission', models.ForeignKey(to='auth.Permission', verbose_name='permission', on_delete=models.CASCADE)), ], options={ 'verbose_name': 'group collection permission', diff --git a/wagtail/wagtaildocs/migrations/0005_document_collection.py b/wagtail/wagtaildocs/migrations/0005_document_collection.py index 1886672fb2..c3b4aa0a95 100644 --- a/wagtail/wagtaildocs/migrations/0005_document_collection.py +++ b/wagtail/wagtaildocs/migrations/0005_document_collection.py @@ -16,7 +16,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='document', name='collection', - field=models.ForeignKey(related_name='+', to='wagtailcore.Collection', verbose_name='collection', default=wagtail.wagtailcore.models.get_root_collection_id), + field=models.ForeignKey(related_name='+', to='wagtailcore.Collection', verbose_name='collection', default=wagtail.wagtailcore.models.get_root_collection_id, on_delete=models.CASCADE), preserve_default=True, ), ] diff --git a/wagtail/wagtailimages/migrations/0011_image_collection.py b/wagtail/wagtailimages/migrations/0011_image_collection.py index b378518bdd..3ead22a49f 100644 --- a/wagtail/wagtailimages/migrations/0011_image_collection.py +++ b/wagtail/wagtailimages/migrations/0011_image_collection.py @@ -16,6 +16,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='image', name='collection', - field=models.ForeignKey(to='wagtailcore.Collection', verbose_name='collection', default=wagtail.wagtailcore.models.get_root_collection_id, related_name='+'), + field=models.ForeignKey(to='wagtailcore.Collection', verbose_name='collection', default=wagtail.wagtailcore.models.get_root_collection_id, related_name='+', on_delete=models.CASCADE), ), ]