IssueRaiser

Support `@unique` on nullable fields for databases that support it

It would be great if we could take advantage of Postgres's capability to express uniqueness on not null values. Currently if I add the `@unique` constraint on a nullable field I can't have more than 1 record with a null assigned. Further reading on how this can be expressed: https://matjaz.it/tutorial-unique-constraint-on-null-values-in-postgresql/

Posted by ctrlplusb on Dec 17, 2019, 10:55 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

support (Other)

Support `@unique` on nullable fields for databases that support it

ctrlplusbDec 17, 2019, 10:55 PM

It would be great if we could take advantage of Postgres's capability to express uniqueness on not null values. Currently if I add the `@unique` constraint on a nullable field I can't have more than 1 record with a null assigned. Further reading on how this can be expressed: https://matjaz.it/tutorial-unique-constraint-on-null-values-in-postgresql/

Comments (0)

No comments yet. Start the discussion.

Comment on this issue