diff --git a/sql/dolphinscheduler_mysql.sql b/sql/dolphinscheduler_mysql.sql index 55dcf1c8fe..51ea20fbe4 100644 --- a/sql/dolphinscheduler_mysql.sql +++ b/sql/dolphinscheduler_mysql.sql @@ -305,7 +305,7 @@ CREATE TABLE `t_ds_alertgroup`( `create_time` datetime DEFAULT NULL COMMENT 'create time', `update_time` datetime DEFAULT NULL COMMENT 'update time', PRIMARY KEY (`id`), - UNIQUE KEY `t_ds_alertgroup_name_UN` (`group_name`) + UNIQUE KEY `t_ds_alertgroup_name_un` (`group_name`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- ---------------------------- @@ -352,7 +352,7 @@ CREATE TABLE `t_ds_datasource` ( `create_time` datetime NOT NULL COMMENT 'create time', `update_time` datetime DEFAULT NULL COMMENT 'update time', PRIMARY KEY (`id`), - UNIQUE KEY `t_ds_datasource_name_UN` (`name`, `type`) + UNIQUE KEY `t_ds_datasource_name_un` (`name`, `type`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- ---------------------------- diff --git a/sql/dolphinscheduler_postgre.sql b/sql/dolphinscheduler_postgre.sql index cd5dce969c..d97e4e964d 100644 --- a/sql/dolphinscheduler_postgre.sql +++ b/sql/dolphinscheduler_postgre.sql @@ -209,7 +209,7 @@ CREATE TABLE t_ds_alertgroup( create_time timestamp DEFAULT NULL, update_time timestamp DEFAULT NULL, PRIMARY KEY (id), - CONSTRAINT t_ds_alertgroup_name_UN UNIQUE (group_name) + CONSTRAINT t_ds_alertgroup_name_un UNIQUE (group_name) ) ; -- @@ -250,7 +250,7 @@ CREATE TABLE t_ds_datasource ( create_time timestamp NOT NULL , update_time timestamp DEFAULT NULL , PRIMARY KEY (id), - CONSTRAINT t_ds_datasource_name_UN UNIQUE (name, type) + CONSTRAINT t_ds_datasource_name_un UNIQUE (name, type) ) ; -- diff --git a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql index eccd683bfa..098a3c4fff 100644 --- a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql +++ b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql @@ -581,9 +581,9 @@ BEGIN IF NOT EXISTS (SELECT 1 FROM information_schema.STATISTICS WHERE TABLE_NAME='t_ds_alertgroup' AND TABLE_SCHEMA=(SELECT DATABASE()) - AND INDEX_NAME ='t_ds_alertgroup_name_UN') + AND INDEX_NAME ='t_ds_alertgroup_name_un') THEN - ALTER TABLE t_ds_alertgroup ADD UNIQUE KEY `t_ds_alertgroup_name_UN` (`group_name`); + ALTER TABLE t_ds_alertgroup ADD UNIQUE KEY `t_ds_alertgroup_name_un` (`group_name`); END IF; END; @@ -598,12 +598,12 @@ drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName; delimiter d// CREATE PROCEDURE uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName() BEGIN - IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + IF NOT EXISTS (SELECT 1 FROM information_schema.STATISTICS WHERE TABLE_NAME='t_ds_datasource' AND TABLE_SCHEMA=(SELECT DATABASE()) - AND COLUMN_NAME ='t_ds_datasource_name_UN') + AND INDEX_NAME ='t_ds_datasource_name_un') THEN - ALTER TABLE t_ds_datasource ADD UNIQUE KEY `t_ds_datasource_name_UN` (`name`, `type`); + ALTER TABLE t_ds_datasource ADD UNIQUE KEY `t_ds_datasource_name_un` (`name`, `type`); END IF; END; diff --git a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql index d8d7db3ba6..de4cbc3506 100644 --- a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql +++ b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql @@ -611,9 +611,9 @@ CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_alertgroup_A_add_UN_groupName() RET BEGIN IF NOT EXISTS (SELECT 1 FROM pg_stat_all_indexes WHERE relname='t_ds_alertgroup' - AND indexrelname ='t_ds_alertgroup_name_UN') + AND indexrelname ='t_ds_alertgroup_name_un') THEN - ALTER TABLE t_ds_alertgroup ADD CONSTRAINT t_ds_alertgroup_name_UN UNIQUE (group_name); + ALTER TABLE t_ds_alertgroup ADD CONSTRAINT t_ds_alertgroup_name_un UNIQUE (group_name); END IF; END; $$ LANGUAGE plpgsql; @@ -629,9 +629,9 @@ CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName( BEGIN IF NOT EXISTS (SELECT 1 FROM pg_stat_all_indexes WHERE relname='t_ds_datasource' - AND indexrelname ='t_ds_datasource_name_UN') + AND indexrelname ='t_ds_datasource_name_un') THEN - ALTER TABLE t_ds_datasource ADD CONSTRAINT t_ds_datasource_name_UN UNIQUE (name, type); + ALTER TABLE t_ds_datasource ADD CONSTRAINT t_ds_datasource_name_un UNIQUE (name, type); END IF; END; $$ LANGUAGE plpgsql;