package models import "time" // UserGroup is a row of user_groups, the PHP UserGroup model. Membership // lives in the users_groups pivot (User.Groups). Permissions is the raw // jsonable text column. type UserGroup struct { ID uint `gorm:"column:id;primaryKey"` Name string `gorm:"column:name"` Code *string `gorm:"column:code"` Description *string `gorm:"column:description"` Permissions *string `gorm:"column:permissions"` CreatedAt *time.Time `gorm:"column:created_at"` UpdatedAt *time.Time `gorm:"column:updated_at"` } func (UserGroup) TableName() string { return "user_groups" } // The PHP UserGroup::GROUP_GUEST and GROUP_REGISTERED codes, seeded by the // create_user_groups migration. const ( GroupGuest = "guest" GroupRegistered = "registered" ) func init() { Register(UserGroup{}) }