Browse Source

update sql

main
ning 1 year ago
parent
commit
bb99ba3d1c
3 changed files with 6 additions and 6 deletions
  1. +2
    -2
      docker/initsql/a-n9e.sql
  2. +2
    -2
      docker/migratesql/migrate.sql
  3. +2
    -2
      models/migrate/migrate.go

+ 2
- 2
docker/initsql/a-n9e.sql View File

@@ -456,7 +456,7 @@ CREATE TABLE `alert_cur_event` (
`annotations` text not null comment 'annotations',
`rule_config` text not null comment 'annotations',
`tags` varchar(1024) not null default '' comment 'merge data_tags rule_tags, split by ,,',
`original_tags` varchar(1024) default '' comment 'labels key=val,,k2=v2',
`original_tags` text comment 'labels key=val,,k2=v2',
PRIMARY KEY (`id`),
KEY (`hash`),
KEY (`rule_id`),
@@ -496,7 +496,7 @@ CREATE TABLE `alert_his_event` (
`recover_time` bigint not null default 0,
`last_eval_time` bigint not null default 0 comment 'for time filter',
`tags` varchar(1024) not null default '' comment 'merge data_tags rule_tags, split by ,,',
`original_tags` varchar(1024) default '' comment 'labels key=val,,k2=v2',
`original_tags` text comment 'labels key=val,,k2=v2',
`annotations` text not null comment 'annotations',
`rule_config` text not null comment 'annotations',
PRIMARY KEY (`id`),


+ 2
- 2
docker/migratesql/migrate.sql View File

@@ -82,5 +82,5 @@ ALTER TABLE users ADD COLUMN last_active_time BIGINT NOT NULL DEFAULT 0;
ALTER TABLE recording_rule ADD COLUMN cron_pattern VARCHAR(255) DEFAULT '' COMMENT 'cron pattern';

/* v7.0.0-beta.14 */
ALTER TABLE alert_cur_event ADD COLUMN original_tags VARCHAR(1024) DEFAULT '' COMMENT 'labels key=val,,k2=v2';
ALTER TABLE alert_his_event ADD COLUMN original_tags VARCHAR(1024) DEFAULT '' COMMENT 'labels key=val,,k2=v2';
ALTER TABLE alert_cur_event ADD COLUMN original_tags TEXT COMMENT 'labels key=val,,k2=v2';
ALTER TABLE alert_his_event ADD COLUMN original_tags TEXT COMMENT 'labels key=val,,k2=v2';

+ 2
- 2
models/migrate/migrate.go View File

@@ -219,11 +219,11 @@ type TaskRecord struct {
}
type AlertHisEvent struct {
LastEvalTime int64 `gorm:"column:last_eval_time;bigint(20);not null;default:0;comment:for time filter;index:idx_last_eval_time"`
OriginalTags string `gorm:"column:original_tags;type:varchar(1024);default:'';comment:labels key=val,,k2=v2"`
OriginalTags string `gorm:"column:original_tags;type:text;comment:labels key=val,,k2=v2"`
}

type AlertCurEvent struct {
OriginalTags string `gorm:"column:original_tags;type:varchar(1024);default:'';comment:labels key=val,,k2=v2"`
OriginalTags string `gorm:"column:original_tags;type:text;comment:labels key=val,,k2=v2"`
}

type Target struct {


Loading…
Cancel
Save