I need to have an Organization
which have relation to parent one. Something like this:
type Organization struct {
gorm.Model
Parent *Organization `gorm:"ForeignKey:ParentId"`
Name string `gorm:"size:30"`
Description string `gorm:"size:100"`
}
I want to have ParentId
field which will be referenced to id
field in the same table. But as I see there is no field and relation.
How can I fix it ?