#32686: Extraneous semicolon displayed on sqlmigrate for multiline RunSQL
operations
------------------------------------------------+--------------------------
               Reporter:  Hannes Ljungberg      |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  assigned
              Component:  Migrations            |        Version:  3.2
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+--------------------------
 For example:
 {{{
 migrations.RunSQL(
     """
     INSERT INTO test_runsql_pony (pink, weight) VALUES (1, 1);
     """,
     migrations.RunPython.noop
 )
 }}}

 Will output:
 {{{

             INSERT INTO test_runsql_pony (pink, weight) VALUES (1, 1);
             ;
 }}}

 As in:
 {{{
 '\n            INSERT INTO test_runsql_pony (pink, weight) VALUES (1,
 1);\n            ;'
 }}}

 We should at least not output the extra semicolon but one thought could be
 to run `str.strip()` on the SQL string to drop the leading/trailing
 whitespace making it a bit nicer to read.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32686>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.c8c110746a8b06996f4c07462e77ae6f%40djangoproject.com.

Reply via email to