@ -99,6 +99,7 @@ insert into `role_operation`(role_name, operation) values('Standard', 'alert_rul
insert into ` role_operation ` ( role_name , operation ) values ( ' Standard ' , ' alert_rule_modify ' ) ;
insert into ` role_operation ` ( role_name , operation ) values ( ' Standard ' , ' alert_rule_delete ' ) ;
insert into ` role_operation ` ( role_name , operation ) values ( ' Standard ' , ' alert_event_delete ' ) ;
insert into ` role_operation ` ( role_name , operation ) values ( ' Standard ' , ' alert_event_modify ' ) ;
insert into ` role_operation ` ( role_name , operation ) values ( ' Standard ' , ' collect_rule_create ' ) ;
insert into ` role_operation ` ( role_name , operation ) values ( ' Standard ' , ' collect_rule_modify ' ) ;
insert into ` role_operation ` ( role_name , operation ) values ( ' Standard ' , ' collect_rule_delete ' ) ;
@ -295,6 +296,8 @@ CREATE TABLE `alert_event` (
` rule_id ` bigint unsigned not null ,
` rule_name ` varchar ( 255 ) not null ,
` rule_note ` varchar ( 512 ) not null default ' alert rule note ' ,
` processor_uid ` bigint NOT NULL default 0 ,
` event_note ` varchar ( 512 ) not null default ' alert event note ' ,
` res_classpaths ` varchar ( 1024 ) not null default ' ' comment ' belong classpaths ' ,
` priority ` tinyint ( 1 ) not null ,
` status ` tinyint ( 1 ) not null ,
@ -314,24 +317,26 @@ CREATE TABLE `alert_event` (
) ENGINE = InnoDB DEFAULT CHARSET = utf8 ;
CREATE TABLE ` history_alert_event ` (
` id ` bigint unsigned NOT NULL AUTO_INCREMENT ,
` hash_id ` varchar ( 255 ) NOT NULL COMMENT ' rule_id + point_pk ' ,
` rule_id ` bigint unsigned NOT NULL ,
` rule_name ` varchar ( 255 ) NOT NULL ,
` rule_note ` varchar ( 512 ) NOT NULL DEFAULT ' alert rule note ' ,
` res_classpaths ` varchar ( 1024 ) NOT NULL DEFAULT ' ' COMMENT ' belong classpaths ' ,
` priority ` tinyint ( 1 ) NOT NULL ,
` status ` tinyint ( 1 ) NOT NULL ,
` is_prome_pull ` tinyint ( 1 ) NOT NULL ,
` is_recovery ` tinyint ( 1 ) NOT NULL ,
` id ` bigint unsigned not null AUTO_INCREMENT ,
` hash_id ` varchar ( 255 ) not null COMMENT ' rule_id + point_pk ' ,
` rule_id ` bigint unsigned not null ,
` rule_name ` varchar ( 255 ) not null ,
` rule_note ` varchar ( 512 ) not null default ' alert rule note ' ,
` processor_uid ` bigint not null default 0 ,
` event_note ` varchar ( 512 ) not null default ' alert event note ' ,
` res_classpaths ` varchar ( 1024 ) not null default ' ' COMMENT ' belong classpaths ' ,
` priority ` tinyint ( 1 ) not null ,
` status ` tinyint ( 1 ) not null ,
` is_prome_pull ` tinyint ( 1 ) not null ,
` is_recovery ` tinyint ( 1 ) not null ,
` history_points ` text COMMENT ' metric, history points ' ,
` trigger_time ` bigint NOT NULL ,
` notify_channels ` varchar ( 255 ) NOT NULL DEFAULT ' ' ,
` notify_groups ` varchar ( 255 ) NOT NULL DEFAULT ' ' ,
` notify_users ` varchar ( 255 ) NOT NULL DEFAULT ' ' ,
` runbook_url ` varchar ( 255 ) DEFAULT NULL ,
` readable_expression ` varchar ( 1024 ) NOT NULL COMMENT ' e.g. mem.bytes.used.percent(all,60s) > 0 ' ,
` tags ` varchar ( 1024 ) NOT NULL DEFAULT ' merge data_tags rule_tags and res_tags ' ,
` trigger_time ` bigint not null ,
` notify_channels ` varchar ( 255 ) not null default ' ' ,
` notify_groups ` varchar ( 255 ) not null default ' ' ,
` notify_users ` varchar ( 255 ) not null default ' ' ,
` runbook_url ` varchar ( 255 ) default NULL ,
` readable_expression ` varchar ( 1024 ) not null COMMENT ' e.g. mem.bytes.used.percent(all,60s) > 0 ' ,
` tags ` varchar ( 1024 ) not null default ' merge data_tags rule_tags and res_tags ' ,
PRIMARY KEY ( ` id ` ) ,
KEY ` hash_id ` ( ` hash_id ` ) ,
KEY ` rule_id ` ( ` rule_id ` ) ,