为新增字段提供默认值

This commit is contained in:
Akkia 2022-09-14 12:16:24 +08:00
parent 0aaf642f69
commit 13abf2af13
No known key found for this signature in database
GPG Key ID: DABE9A4AB2DD7EF3

View File

@ -28,10 +28,10 @@ type AlertRule struct {
Name string
RulesRaw string
Enable *bool
TriggerMode int `gorm:"default:0"` // 触发模式: 0-始终触发(默认) 1-单次触发
NotificationTag string // 该报警规则所在的通知组
FailTriggerTasksRaw string
RecoverTriggerTasksRaw string
TriggerMode int `gorm:"default:0"` // 触发模式: 0-始终触发(默认) 1-单次触发
NotificationTag string // 该报警规则所在的通知组
FailTriggerTasksRaw string `gorm:"default:'[]'"`
RecoverTriggerTasksRaw string `gorm:"default:'[]'"`
Rules []Rule `gorm:"-" json:"-"`
FailTriggerTasks []uint64 `gorm:"-" json:"-"` // 失败时执行的触发任务id
RecoverTriggerTasks []uint64 `gorm:"-" json:"-"` // 恢复时执行的触发任务id