Opened 4 years ago

Closed 4 years ago

#31702 closed New feature (fixed)

Support operator classes for unique indexes on PostgreSQL.

Reported by: Hannes Ljungberg Owned by: Hannes Ljungberg
Component: Database layer (models, ORM) Version: dev
Severity: Normal 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

UniqueConstraint should allow setting opclasses just like Index:

class Meta:
    constraints = [
        UniqueConstraint(
            name='test_ops_class',
            fields=['scene'],
            opclasses=['varchar_pattern_ops'],
        )
    ]

Change History (6)

comment:1 by Hannes Ljungberg, 4 years ago

Has patch: set

comment:2 by Mariusz Felisiak, 4 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 4 years ago

Summary: Allow specifying custom operator classes for PostgreSQL unique indexesSupport operator classes for unique indexes on PostgreSQL.

comment:4 by Alexandr Tatarinov, 4 years ago

Look reasonable to me, the patch is okay, has docs and tests. Index require to provide name with opclasses, so probably UniqueConstraint should require name as well.

Version 0, edited 4 years ago by Alexandr Tatarinov (next)

comment:5 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In 7edc6e5:

Fixed #31702 -- Added support for PostgreSQL opclasses in UniqueConstraint.

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