]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Convert RunSQL migration commands from list to strings
authorDaniel Axtens <dja@axtens.net>
Tue, 9 Aug 2016 04:55:19 +0000 (14:55 +1000)
committerStephen Finucane <stephenfinucane@hotmail.com>
Sun, 21 Aug 2016 15:59:55 +0000 (16:59 +0100)
The ability to use a list was added in Django 1.8 - compare

https://docs.djangoproject.com/en/1.7/ref/migration-operations/#runsql
https://docs.djangoproject.com/en/1.8/ref/migration-operations/#runsql

We don't need a list as we run only 1 SQL command. So convert to
strings. This helps unbreak Django 1.7.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
patchwork/migrations/0010_migrate_data_from_submission_to_patch.py

index 1d4b6e1793ca9efcd945ca2c3e468c0050c190c6..fe4291b84c9a9f6704f19cc689f9573e1b4a6e6a 100644 (file)
@@ -12,19 +12,19 @@ class Migration(migrations.Migration):
 
     operations = [
         migrations.RunSQL(
-            ['''INSERT INTO patchwork_patch
+            '''INSERT INTO patchwork_patch
                   (submission_ptr_id, diff2, commit_ref2, pull_url2,
                    delegate2_id, state2_id, archived2, hash2)
                 SELECT id, diff, commit_ref, pull_url, delegate_id, state_id,
                        archived, hash
                 FROM patchwork_submission
-                '''],
-            ['''UPDATE patchwork_submission SET
+                ''',
+            '''UPDATE patchwork_submission SET
                   diff=diff2, commit_ref=commit_ref2, pull_url=pull_url2,
                   delegate_id=delegate2_id, state_id=state2_id,
                   archived=archived2, hash=hash2
                 FROM patchwork_patch WHERE
                   patchwork_submission.id = patchwork_patch.submission_ptr_id
-                ''']
+                '''
         ),
     ]