use non-default foreign key in example
This commit is contained in:
parent
46d24b77a4
commit
1936549a66
@ -47,8 +47,8 @@ type Profile struct {
|
||||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Profile Profile `gorm:"foreignkey:ProfileID;association_foreignkey:Refer"`
|
||||
ProfileID int
|
||||
Profile Profile `gorm:"foreignkey:ProfileRefer;association_foreignkey:Refer"`
|
||||
ProfileRefer int
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user