How to setup unique constraint with soft delete enabled #7799
Answered
by
talgat-ruby
talgat-ruby
asked this question in
Question
-
Basically with Postgres
won't work. In raw query uniqueness can be achieved with
Is there workaround for Hasura? |
Beta Was this translation helpful? Give feedback.
Answered by
talgat-ruby
Jan 4, 2025
Replies: 1 comment 2 replies
-
@talgat-ruby did you found a way? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @jdinartejesus,
If you are using postgres 15 or newer you can use new constraint
UNIQUE NULLS NOT DISTINCT
. If not than it is possible only via workaround like not using null.More on stackoverflow question.