package domain //Company reflects a company record of company table. type Company struct { ID uint `gorm:"column:company_id;primary_key"` Code string `gorm:"column:company_code"` Name string `gorm:"column:company_name"` Roles []Role `gorm:"foreignkey:CompanyID"` } // TableName returns the name of the Users table func (Company) TableName() string { return "company" }