Opened 3 years ago
Closed 3 years ago
#32686 closed Cleanup/optimization (fixed)
Extraneous semicolon displayed on sqlmigrate for multiline RunSQL operations
Reported by: | Hannes Ljungberg | Owned by: | Hannes Ljungberg |
---|---|---|---|
Component: | Migrations | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (6)
comment:1 Changed 3 years ago by
Has patch: | set |
---|
comment:2 Changed 3 years ago by
Owner: | changed from nobody to Hannes Ljungberg |
---|
comment:3 Changed 3 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 Changed 3 years ago by
Triage Stage: | Accepted → Ready for checkin |
---|
Note: See
TracTickets for help on using
tickets.
PR: https://github.com/django/django/pull/14314