From e4dbd88810d76da2de4ddd507d08d9a86a6e8012 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Thu, 22 Dec 2022 10:28:16 +0000 Subject: [PATCH] Remove unique constraint before using `GenericForeignKey` in `WorkflowState` Prevent migrations crash on SQLite before https://github.com/django/django/pull/15175 landed in Django --- wagtail/migrations/0080_generic_workflowstate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wagtail/migrations/0080_generic_workflowstate.py b/wagtail/migrations/0080_generic_workflowstate.py index ebe19a03c0..b4368f5043 100644 --- a/wagtail/migrations/0080_generic_workflowstate.py +++ b/wagtail/migrations/0080_generic_workflowstate.py @@ -10,6 +10,10 @@ class Migration(migrations.Migration): ] operations = [ + migrations.RemoveConstraint( + model_name="workflowstate", + name="unique_in_progress_workflow", + ), migrations.AlterField( model_name="workflowstate", name="page", @@ -54,10 +58,6 @@ class Migration(migrations.Migration): name="workflowstate_base_ct_id_idx", ), ), - migrations.RemoveConstraint( - model_name="workflowstate", - name="unique_in_progress_workflow", - ), migrations.AddConstraint( model_name="workflowstate", constraint=models.UniqueConstraint(