You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ca...@apache.org on 2022/03/13 00:39:17 UTC

[dolphinscheduler] branch dev updated: to issue/#8826 (#8827)

This is an automated email from the ASF dual-hosted git repository.

caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new b0ffec5  to issue/#8826 (#8827)
b0ffec5 is described below

commit b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe
Author: ouyangyewei <ou...@foxmail.com>
AuthorDate: Sun Mar 13 08:39:05 2022 +0800

    to issue/#8826 (#8827)
    
    Co-authored-by: ouyangyewei <ye...@alibaba-inc.com>
---
 dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql | 3 ++-
 .../src/main/resources/sql/dolphinscheduler_postgresql.sql             | 2 ++
 .../resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql  | 2 ++
 .../sql/upgrade/2.1.0_schema/postgresql/dolphinscheduler_ddl.sql       | 3 +++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql
index bfc6c79..00238b1 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql
@@ -285,7 +285,8 @@ CREATE TABLE `t_ds_alert` (
   `alertgroup_id` int(11) DEFAULT NULL COMMENT 'alert group id',
   `create_time` datetime DEFAULT NULL COMMENT 'create time',
   `update_time` datetime DEFAULT NULL COMMENT 'update time',
-  PRIMARY KEY (`id`)
+  PRIMARY KEY (`id`),
+  KEY `idx_status` (`alert_status`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
 
 -- ----------------------------
diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
index a0329b7..9d941f9 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
@@ -217,6 +217,8 @@ CREATE TABLE t_ds_alert (
   PRIMARY KEY (id)
 ) ;
 
+create index idx_status on t_ds_alert (alert_status);
+
 --
 -- Table structure for table t_ds_alertgroup
 --
diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql
index b33b580..c5a667a 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/mysql/dolphinscheduler_ddl.sql
@@ -31,6 +31,8 @@ alter table t_ds_task_definition add `task_group_priority` int(11) DEFAULT '0' C
 
 ALTER TABLE `t_ds_user` ADD COLUMN `time_zone` varchar(32) DEFAULT NULL COMMENT 'time zone';
 
+ALTER TABLE `t_ds_alert` ADD INDEX `idx_status` (`alert_status`) USING BTREE;
+
 --
 -- Table structure for table `t_ds_dq_comparison_type`
 --
diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/postgresql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/postgresql/dolphinscheduler_ddl.sql
index 1943262..ecfbc76 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/postgresql/dolphinscheduler_ddl.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.1.0_schema/postgresql/dolphinscheduler_ddl.sql
@@ -156,6 +156,9 @@ EXECUTE 'CREATE TABLE IF NOT EXISTS' || quote_ident(v_schema) ||'."t_ds_relation
     CONSTRAINT t_ds_relation_rule_input_entry_pk PRIMARY KEY (id)
 )';
 
+EXECUTE 'DROP INDEX IF EXISTS "idx_alert_status"';
+EXECUTE 'CREATE INDEX IF NOT EXISTS idx_alert_status ON ' || quote_ident(v_schema) ||'.t_ds_alert USING Btree("alert_status")';
+
 EXECUTE 'DROP INDEX IF EXISTS "idx_task_definition_log_project_code"';
 EXECUTE 'CREATE INDEX IF NOT EXISTS idx_task_definition_log_project_code ON ' || quote_ident(v_schema) ||'.t_ds_task_definition_log USING Btree("project_code")';