let say one teacher has many students and student only has one teacher, how to implement it on Gorm Golang ?
my opinion is
type Teacher struct {
gorm.Model
Name string
Student []Student
}
type Student struct {
gorm.Model
Name string
}
is those correct ?? and if not how to make it to be associated? and how about if we query it to create ? should I create another StudentID on it ?