Guest User

go/gorm

a guest
Mar 22nd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.29 KB | None | 0 0
  1. type Student struct {
  2.     ID uint64 `sql:"AUTO_INCREMENT" gorm:"primary_key"`
  3. }
  4.  
  5. type Struct1 struct {
  6.     ID uint64 `sql:"AUTO_INCREMENT" gorm:"primary_key"`
  7.     StudentID uint64 // foreign key, такого же типка как и Student.ID
  8.     Student    Student // или *Student
  9. }
Add Comment
Please, Sign In to add comment