-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create Postgres index with "NULLS NOT DISTINCT"? #6085
Comments
currently not supported |
Any plans to implement this? |
Just use pointers to make this fields nullable type SomethingThird struct {
ID int64
SomethingFirstID *int64 `gorm:"index:,unique"`
SomethingSecondID *int64 `gorm:"index:,unique"`
} |
Did work or not? |
It does not work when I tested it locally |
Thank you for raising this issue; I, too, have run into this exact problem. |
How would I create a Postgresql index with
NULLS NOT DISTINCT
option in gorm?Tried it with
gorm:"index:,option:NULLS NOT DISTINCT"
, but it didn't work.See this if you need more context:
https://stackoverflow.com/questions/8289100/create-unique-constraint-with-null-columns
The text was updated successfully, but these errors were encountered: