Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#30062 closed New feature (fixed)

Add UniqueConstraint condition parameter

Reported by: Pavel Tyslacki Owned by: Pavel Tyslacki
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 Tim Graham)

According #29641 and #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 (7)

comment:1 by Simon Charette, 6 years ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted

I don't think deprecating index_together is 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).

comment:2 by Tim Graham, 6 years ago

Description: modified (diff)
Has patch: unset

comment:3 by Simon Charette, 6 years ago

Has patch: set
Patch needs improvement: set
Last edited 6 years ago by Tim Graham (previous) (diff)

comment:4 by Pavel Tyslacki, 6 years ago

Owner: changed from nobody to Pavel Tyslacki
Patch needs improvement: unset
Status: newassigned

comment:5 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In b69f8eb0:

Fixed #30062 -- Added support for unique conditional constraints.

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 6 years ago

In 5402061c:

Refs #30062 -- Corrected UniqueConstraint signature in docs.

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 6 years ago

In 83605a17:

[2.2.x] Refs #30062 -- Corrected UniqueConstraint signature in docs.

Backport of 5402061c80aa2ede08a7c6b3ff204646c5059cf7 from master

Note: See TracTickets for help on using tickets.
Back to Top