We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go-gorm/playground#277
The reference key denoted in the parent model should be passed on to the child (has one) model on creation.. However this does not happen via gorm v2
The text was updated successfully, but these errors were encountered:
628a0ae
Fixed, thank you for your report, btw, you need to create a unique index for the uuid field to use it as a foreign key. e.g:
type User struct { gorm.Model Name string Age uint Birthday *time.Time Account Account Pets []*Pet Toys []Toy `gorm:"polymorphic:Owner"` CompanyID *int Company Company UUID string `gorm:"size:20;uniqueIndex"` Aux *UserAux `gorm:"foreignkey:UUID;references:uuid"` ManagerID *uint Manager *User Team []User `gorm:"foreignkey:ManagerID"` Languages []Language `gorm:"many2many:UserSpeak"` Friends []*User `gorm:"many2many:user_friends"` Active bool }
Sorry, something went wrong.
Fix foreign key & reference with same name, close go-gorm#4081
44f0bc1
53f6064
jinzhu
No branches or pull requests
GORM Playground Link
go-gorm/playground#277
Description
The reference key denoted in the parent model should be passed on to the child (has one) model on creation.. However this does not happen via gorm v2
The text was updated successfully, but these errors were encountered: