[Django] #29812: AlterUniqueTogether creates invalid SQL for app with hyphen in name

7 views
Skip to first unread message

Django

unread,
Oct 1, 2018, 4:01:04 PM10/1/18
to django-...@googlegroups.com
#29812: AlterUniqueTogether creates invalid SQL for app with hyphen in name
-----------------------------------------+--------------------------------
Reporter: Carl Johnson | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 2.1
Severity: Normal | Keywords: migrations SQL
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+--------------------------------
Background:

I am using Django 2.1.1 with Postgresql. I attempted to create a
unique_together field for an app with the name "mencken-admin".

Result:

I got a traceback ending with


{{{
django.db.utils.ProgrammingError: syntax error at or near "-"
LINE 1: ...LE "mencken-admin_sitepage" ADD CONSTRAINT mencken-admin_sit...

}}}

And then a little carrot (can't type it in the bug system) indicating that
the error was the hyphen in mencken-admin_sitepage.

I believe the problem is that the constraint name needs to be escaped
somehow.

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

Django

unread,
Oct 1, 2018, 5:20:27 PM10/1/18
to django-...@googlegroups.com
#29812: AlterUniqueTogether creates invalid SQL for app with hyphen in name
--------------------------------+--------------------------------------

Reporter: Carl Johnson | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 2.1
Severity: Normal | Resolution: duplicate

Keywords: migrations SQL | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* type: Uncategorized => Bug
* component: Uncategorized => Migrations
* resolution: => duplicate


Comment:

Looks like a duplicate of #29778 which is fixed in Django 2.1.2.

--
Ticket URL: <https://code.djangoproject.com/ticket/29812#comment:1>

Django

unread,
Oct 1, 2018, 5:25:19 PM10/1/18
to django-...@googlegroups.com
#29812: AlterUniqueTogether creates invalid SQL for app with hyphen in name
--------------------------------+--------------------------------------

Reporter: Carl Johnson | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 2.1
Severity: Normal | Resolution: duplicate
Keywords: migrations SQL | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Carl Johnson):

Upgrading fixed it. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/29812#comment:2>

Reply all
Reply to author
Forward
0 new messages