mysql不支持bool类型需要使用int表示

type CoreAutoTask struct {
ID uint `gorm:"primary_key;AUTO_INCREMENT" json:"id"`
SourceId string `gorm:"type:varchar(200);not null;index:source_idx" json:"source_id"`
DataBase string `gorm:"type:varchar(50);not null" json:"data_base"`
Name string `gorm:"type:varchar(50);not null" json:"name"`
Source string `gorm:"type:varchar(50);not null" json:"source"`
Table string `gorm:"type:varchar(50);not null" json:"table"`
Tp int `gorm:"type:tinyint(2);not null" json:"tp"` // 0 insert 1 update 2delete
Affectrow uint `gorm:"type:int(50);not null default 0;" json:"affect_rows"`
Status int `gorm:"type:tinyint(2);not null default 0" json:"status"` // 0 close 1 on
TaskId string `gorm:"type:varchar(200);not null;index:task_idx" json:"task_id"`
IDC string `gorm:"type:varchar(50);not null" json:"idc"`
}
posted @ 2024-07-14 21:37  技术颜良  阅读(1)  评论(0编辑  收藏  举报