#30062: Add UniqueConstraint condition parameter
-------------------------------------+-------------------------------------
     Reporter:  Pavel Tyslacki       |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

 * stage:  Unreviewed => Accepted


Old description:

> 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.
>
> `unique_together` can be marked as deprecated in future as
> `index_together` is.

New description:

 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.

--

Comment:

 I don't think deprecating `index_together` is currently planned but
 [https://docs.djangoproject.com/en/2.1/ref/models/options/#index-together
 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)`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30062#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.f1bfd3e0dc1a3a0342898ce06d1ae4b6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to