Opened 11 months ago
Closed 11 months ago
#35992 closed Bug (fixed)
Migrations crash on constraints/indexes with CompositePrimaryKey.
| Reported by: | Mariusz Felisiak | Owned by: | Mariusz Felisiak |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Release blocker | 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
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.
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.
Attachments (1)
Change History (6)
by , 11 months ago
| Attachment: | ticket_373_uq_composite.zip added |
|---|
comment:1 by , 11 months ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:4 by , 11 months ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
Thank you for testing!