Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Student struct {
- ID uint64 `sql:"AUTO_INCREMENT" gorm:"primary_key"`
- }
- type Struct1 struct {
- ID uint64 `sql:"AUTO_INCREMENT" gorm:"primary_key"`
- StudentID uint64 // foreign key, такого же типка как и Student.ID
- Student Student // или *Student
- }
Add Comment
Please, Sign In to add comment