package model type Plan struct { Id string `json:"id" gorm:"type:varchar(128);not null"` Title string `json:"title" gorm:"type:varchar(30);not null"` Version string `json:"version" gorm:"type:varchar(20);not null"` State int `json:"state" gorm:"type:int; not null"` Description string `json:"description" gorm:"type:longtext;not null"` StatementFile string `json:"statementFile" gorm:"column:statement_file;type:longtext;not null"` Delete int `json:"delete" gorm:"type:tinyint(1);not null"` CreatorId string `json:"creatorId" gorm:"column:creator_id;type:varchar(128);not null"` SoftwareId string `json:"softwareId" gorm:"column:software_id;type:varchar(128);not null"` CreatedAt Time `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"` UpdatedAt Time `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"` } func (Plan) TableName() string { return "plan" } type Plan2Group struct { ID uint `gorm:"primary_key;type:int(11) auto_increment"` PlanId string `gorm:"column:plan_id"` GroupId string `gorm:"column:group_id"` } func (Plan2Group) TableName() string { return "plan_groups" }