Changes between Version 1 and Version 2 of Ticket #30916
- Timestamp:
- Oct 27, 2019, 6:20:23 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30916 – Description
v1 v2 1 Case insensitive unique constraint is needed for various purposes like storing emails. In postgresql, its possible to add [https://www.postgresql.org/message-id/c57a8ecec259afdc4f4caafc5d0e92eb@mitre.org , a functional unique index with `Lower`] and it will work as a case insensitive unique constraint. I have tried to implement that functional unique index/constraint in django, but looking at the source it seems that it is not possible to add functional unique index/constraint in django. [https://github.com/django/django/pull/11929,PR 11929] is created for adding functional index, but it seems like it is not possible to create unique functional index with it.1 Case insensitive unique constraint is needed for various purposes like storing emails. In postgresql, its possible to add [https://www.postgresql.org/message-id/c57a8ecec259afdc4f4caafc5d0e92eb@mitre.org a functional unique index with `Lower`] and it will work as a case insensitive unique constraint. I have tried to implement that functional unique index/constraint in django, but looking at the source it seems that it is not possible to add functional unique index/constraint in django. [https://github.com/django/django/pull/11929 PR 11929] is created for adding functional index, but it seems like it is not possible to create unique functional index with it. 2 2 3 3 I think there should be a option like `case_insensitive=True` that can be passed to `UniqueConstraint` so the `UniqueConstraint` create a functional unique index with `Lower`.