﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30916	Added support for functional constraints.	Safwan Rahman	Hannes Ljungberg	"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.

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`.

I know, its possible to store the value as lower case always and mitigate this issue, but it does not provide DB level constrains safety from anomaly."	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	constraint functional	Ian Foote Hannes Ljungberg	Ready for checkin	1	0	0	0	0	0
