Opened 7 years ago
Last modified 7 years ago
#30062 closed New feature
Add UniqueConstraint condition parameter — at Version 1
| Reported by: | Pavel Tyslacki | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
According https://code.djangoproject.com/ticket/29641 and https://code.djangoproject.com/ticket/29547 add support of conditional unique constraint.
Postgresql and sqlite support it as unique index: CREATE UNIQUE INDEX ... WHERE condition, for unsupported databases this constraint will not be applied at all.
Change History (1)
comment:1 by , 7 years ago
| Description: | modified (diff) |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
I don't think deprecating
index_togetheris currently planned but the documentation do suggest it might be in the future.I adjusted the ticket description and created #30063 so this ticket can focus on
UniqueConstraint(condition).