GORM Playground Link
https://github.com/go-gorm/playground/pull/690
Description
Ran into a similar issue and reproduced it in the playground, should this work or no?
If this should work, then I guess this is a bug?
Comment From: black-06
Its mistake is
main_test.go:50 UNIQUE constraint failed: profiles.ssn
Obviously, the SSN of the two Profile you created are both empty strings, it cannot satisfy unique index constraints
Comment From: swills
I understand it does not work now. It seems it should be allowed to have a uniqueIndex field, even in the case of a "has many" relationship. But due to the way the association is implemented, this happens, which seems to be a bug to me.