]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
migrations: Mark 'RunPython' blocks as non-atomic
authorStephen Finucane <stephen@that.guru>
Fri, 19 May 2017 14:53:18 +0000 (15:53 +0100)
committerStephen Finucane <stephen@that.guru>
Sun, 3 Dec 2017 20:54:35 +0000 (20:54 +0000)
This appears to be required to run migrations on MySQL backend. Without
this, the following error messages are propagated:

    Executing DDL statements while in a transaction on databases that
    can't perform a rollback is prohibited.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Tested-by: Daniel Axtens <dja@axtens.net>
patchwork/migrations/0007_move_comment_content_to_patch_content.py
patchwork/migrations/0016_series_project.py

index 43c135ea3c26b4c729958356308ca6f0187b285c..f6ad0576718f313ab9a54ac262070984a83ee2cf 100644 (file)
@@ -91,6 +91,8 @@ class Migration(migrations.Migration):
     ]
 
     operations = [
-        migrations.RunPython(copy_comment_field, uncopy_comment_field),
-        migrations.RunPython(remove_duplicate_comments, recreate_comments),
+        migrations.RunPython(copy_comment_field, uncopy_comment_field,
+                             atomic=False),
+        migrations.RunPython(remove_duplicate_comments, recreate_comments,
+                             atomic=False),
     ]
index 7aea1325d203fa4feba8552ab55b269fc9e619a0..f298b1256e97b67769f80308d4042f8947f47f2d 100644 (file)
@@ -48,7 +48,7 @@ class Migration(migrations.Migration):
             name='project',
             field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='series', to='patchwork.Project'),
         ),
-        migrations.RunPython(forward, reverse),
+        migrations.RunPython(forward, reverse, atomic=False),
         migrations.AlterField(
             model_name='seriesreference',
             name='msgid',