diff --git a/wagtail/migrations/0082_alter_workflowstate_content_type_notnull.py b/wagtail/migrations/0082_alter_workflowstate_content_type_notnull.py new file mode 100644 index 0000000000..86bba23c97 --- /dev/null +++ b/wagtail/migrations/0082_alter_workflowstate_content_type_notnull.py @@ -0,0 +1,33 @@ +# Generated by Django 4.2.dev20221212151407 on 2022-12-12 15:38 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("contenttypes", "0002_remove_content_type_name"), + ("wagtailcore", "0081_populate_workflowstate_content_type"), + ] + + operations = [ + migrations.AlterField( + model_name="workflowstate", + name="base_content_type", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="+", + to="contenttypes.contenttype", + ), + ), + migrations.AlterField( + model_name="workflowstate", + name="content_type", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="+", + to="contenttypes.contenttype", + ), + ), + ] diff --git a/wagtail/models/__init__.py b/wagtail/models/__init__.py index 01491b2e47..599e78dca0 100644 --- a/wagtail/models/__init__.py +++ b/wagtail/models/__init__.py @@ -3855,10 +3855,10 @@ class WorkflowState(models.Model): ) content_type = models.ForeignKey( - ContentType, on_delete=models.CASCADE, related_name="+", null=True + ContentType, on_delete=models.CASCADE, related_name="+" ) base_content_type = models.ForeignKey( - ContentType, on_delete=models.CASCADE, related_name="+", null=True + ContentType, on_delete=models.CASCADE, related_name="+" ) object_id = models.CharField(max_length=255, verbose_name=_("object id"))