#35992: Migrations crash on constraints/indexes with CompositePrimaryKey.
-------------------------------------+-------------------------------------
               Reporter:  Mariusz    |          Owner:  Mariusz Felisiak
  Felisiak                           |
                   Type:  Bug        |         Status:  assigned
              Component:  Database   |        Version:  dev
  layer (models, ORM)                |
               Severity:  Release    |       Keywords:
  blocker                            |
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I've created a sample project that tries to add `UniqueConstraint` with a
 `CompositePrimaryKey`. Unfortunately, it crashes with programming error
 because `CompositePrimaryKey` is resolved to tuple, e.g.
 {{{#!sql
 CREATE UNIQUE INDEX "uq_mix" ON "test373composite_release" (("version",
 "name"));
 }}}

 {{{
   File "/ticket_373_uq_composite/lib/python3.12/site-
 packages/psycopg/cursor.py", line 97, in execute
     raise ex.with_traceback(None)
 django.db.utils.ProgrammingError: syntax error at or near ","
 LINE 1: ..."uq_mix" ON "test373composite_release" (("version", "name"))
                                                              ^
 }}}

 I've attached a sample project. I can prepare a patch in the coming days.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35992>
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 visit 
https://groups.google.com/d/msgid/django-updates/01070193ada2c4e0-18a5aad0-d3c7-4442-afb0-781b081c569f-000000%40eu-central-1.amazonses.com.

Reply via email to