|
@@ -16,6 +16,10 @@
|
|
|
*/
|
|
|
|
|
|
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
|
|
|
+
|
|
|
+-- ----------------------------
|
|
|
+-- Table structure for t_ds_plugin_define
|
|
|
+-- ----------------------------
|
|
|
DROP TABLE IF EXISTS `t_ds_plugin_define`;
|
|
|
CREATE TABLE `t_ds_plugin_define` (
|
|
|
`id` int NOT NULL AUTO_INCREMENT,
|
|
@@ -28,6 +32,13 @@ CREATE TABLE `t_ds_plugin_define` (
|
|
|
UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`)
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
|
|
|
|
|
+-- ----------------------------
|
|
|
+-- Records of t_ds_plugin_define
|
|
|
+-- ----------------------------
|
|
|
+
|
|
|
+-- ----------------------------
|
|
|
+-- Table structure for t_ds_alert_plugin_instance
|
|
|
+-- ----------------------------
|
|
|
DROP TABLE IF EXISTS `t_ds_alert_plugin_instance`;
|
|
|
CREATE TABLE `t_ds_alert_plugin_instance` (
|
|
|
`id` int NOT NULL AUTO_INCREMENT,
|
|
@@ -39,31 +50,101 @@ CREATE TABLE `t_ds_alert_plugin_instance` (
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
|
|
-ALTER TABLE t_ds_process_definition
|
|
|
- ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`;
|
|
|
+-- ----------------------------
|
|
|
+-- Records of t_ds_alert_plugin_instance
|
|
|
+-- ----------------------------
|
|
|
+
|
|
|
+-- uc_dolphin_T_t_ds_process_definition_A_warning_group_id
|
|
|
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_A_warning_group_id;
|
|
|
+delimiter d//
|
|
|
+CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_A_warning_group_id()
|
|
|
+ BEGIN
|
|
|
+ IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
|
|
|
+ WHERE TABLE_NAME='t_ds_process_definition'
|
|
|
+ AND TABLE_SCHEMA=(SELECT DATABASE())
|
|
|
+ AND COLUMN_NAME ='warning_group_id')
|
|
|
+ THEN
|
|
|
+ ALTER TABLE t_ds_process_definition ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`;
|
|
|
+ END IF;
|
|
|
+ END;
|
|
|
|
|
|
-ALTER TABLE t_ds_process_definition_version
|
|
|
- ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`;
|
|
|
+d//
|
|
|
|
|
|
-ALTER TABLE t_ds_alertgroup
|
|
|
- ADD COLUMN `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids' AFTER `id`,
|
|
|
- ADD COLUMN `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id' AFTER `alert_instance_ids`;
|
|
|
+delimiter ;
|
|
|
+CALL uc_dolphin_T_t_ds_process_definition_A_warning_group_id();
|
|
|
+DROP PROCEDURE uc_dolphin_T_t_ds_process_definition_A_warning_group_id;
|
|
|
|
|
|
+-- uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
|
|
|
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id;
|
|
|
+delimiter d//
|
|
|
+CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id()
|
|
|
+ BEGIN
|
|
|
+ IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
|
|
|
+ WHERE TABLE_NAME='t_ds_process_definition_version'
|
|
|
+ AND TABLE_SCHEMA=(SELECT DATABASE())
|
|
|
+ AND COLUMN_NAME ='warning_group_id')
|
|
|
+ THEN
|
|
|
+ ALTER TABLE t_ds_process_definition_version ADD COLUMN `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `connects`;
|
|
|
+ END IF;
|
|
|
+ END;
|
|
|
+
|
|
|
+d//
|
|
|
+
|
|
|
+delimiter ;
|
|
|
+CALL uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id();
|
|
|
+DROP PROCEDURE uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id;
|
|
|
+
|
|
|
+-- uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
|
|
|
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids;
|
|
|
+delimiter d//
|
|
|
+CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids()
|
|
|
+ BEGIN
|
|
|
+ IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
|
|
|
+ WHERE TABLE_NAME='t_ds_alertgroup'
|
|
|
+ AND TABLE_SCHEMA=(SELECT DATABASE())
|
|
|
+ AND COLUMN_NAME ='alert_instance_ids')
|
|
|
+ THEN
|
|
|
+ ALTER TABLE t_ds_alertgroup ADD COLUMN `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids' AFTER `id`;
|
|
|
+ END IF;
|
|
|
+ END;
|
|
|
+
|
|
|
+d//
|
|
|
+
|
|
|
+delimiter ;
|
|
|
+CALL uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids();
|
|
|
+DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids;
|
|
|
+
|
|
|
+-- uc_dolphin_T_t_ds_alertgroup_A_create_user_id
|
|
|
+drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_A_create_user_id;
|
|
|
+delimiter d//
|
|
|
+CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_create_user_id()
|
|
|
+ BEGIN
|
|
|
+ IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
|
|
|
+ WHERE TABLE_NAME='t_ds_alertgroup'
|
|
|
+ AND TABLE_SCHEMA=(SELECT DATABASE())
|
|
|
+ AND COLUMN_NAME ='create_user_id')
|
|
|
+ THEN
|
|
|
+ ALTER TABLE t_ds_alertgroup ADD COLUMN `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id' AFTER `alert_instance_ids`;
|
|
|
+ END IF;
|
|
|
+ END;
|
|
|
+
|
|
|
+d//
|
|
|
+
|
|
|
+delimiter ;
|
|
|
+CALL uc_dolphin_T_t_ds_alertgroup_A_create_user_id();
|
|
|
+DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_create_user_id;
|
|
|
|
|
|
-- ----------------------------
|
|
|
-- These columns will not be used in the new version,if you determine that the historical data is useless, you can delete it using the sql below
|
|
|
-- ----------------------------
|
|
|
-/*
|
|
|
-ALTER TABLE t_ds_process_definition DROP receivers, DROP receivers_cc;
|
|
|
|
|
|
-ALTER TABLE t_ds_process_definition_version DROP receivers, DROP receivers_cc;
|
|
|
+-- ALTER TABLE t_ds_process_definition DROP receivers, DROP receivers_cc;
|
|
|
|
|
|
-ALTER TABLE t_ds_alert DROP show_type,DROP alert_type,DROP receivers,DROP receivers_cc;
|
|
|
+-- ALTER TABLE t_ds_process_definition_version DROP receivers, DROP receivers_cc;
|
|
|
|
|
|
-ALTER TABLE t_ds_alertgroup DROP group_type;
|
|
|
-
|
|
|
-DROP TABLE IF EXISTS t_ds_relation_user_alertgroup;
|
|
|
-*/
|
|
|
+-- ALTER TABLE t_ds_alert DROP show_type,DROP alert_type,DROP receivers,DROP receivers_cc;
|
|
|
|
|
|
+-- ALTER TABLE t_ds_alertgroup DROP group_type;
|
|
|
|
|
|
+-- DROP TABLE IF EXISTS t_ds_relation_user_alertgroup;
|
|
|
|