Opened 4 years ago
Closed 4 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 by , 4 years ago
Has patch: | set |
---|
comment:2 by , 4 years ago
Owner: | changed from | to
---|
comment:3 by , 4 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 4 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
PR: https://github.com/django/django/pull/14314