Opened 7 years ago
Closed 7 years ago
#28875 closed Bug (wontfix)
SQL: Creation of Index fails with '/' in app_label
Reported by: | Jens L. | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 2.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Django 2's creation of SQLite indicies doesn't escape the index name, which causes issues when you use for example '/' in your app_labels.
Offending file is db/backends/sqlite3/schema.py , line 18.
If said line is swapped with this:
sql_create_unique = "CREATE UNIQUE INDEX \"%(name)s\" ON %(table)s (%(columns)s)"
creation of indices works fine.
Update: This also happens on MySQL (tested on Python 3.5.3, Django 2.0, PyMySQL 0.7.11
Change History (2)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|---|
Summary: | SQLite: Creation of Index fails with '/' in app_label → SQL: Creation of Index fails with '/' in app_label |
comment:2 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
As documented, app labels should be a valid Python identifiers.
I'm afraid that excludes slashes.