You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/10/22 02:31:01 UTC

[dolphinscheduler] branch dev updated: [Fix] [SQL] sql script upgrade exception (#6462)

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

leonbao 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 28004c3  [Fix] [SQL] sql script upgrade exception (#6462)
28004c3 is described below

commit 28004c3b05d4644cce2b649e45ae35ef7c19d2d5
Author: Kerwin <37...@users.noreply.github.com>
AuthorDate: Fri Oct 22 10:30:52 2021 +0800

    [Fix] [SQL] sql script upgrade exception (#6462)
    
    * fix sql syntax error exception.
    
    * update 1.4.0 sql ddl
---
 .../1.4.0_schema/mysql/dolphinscheduler_ddl.sql    | 19 -----------------
 .../postgresql/dolphinscheduler_ddl.sql            | 24 +++-------------------
 2 files changed, 3 insertions(+), 40 deletions(-)

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 3dc764d..663fbc2 100644
--- a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
+++ b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
@@ -337,25 +337,6 @@ delimiter ;
 CALL uc_dolphin_T_t_ds_schedules_A_add_timezone();
 DROP PROCEDURE uc_dolphin_T_t_ds_schedules_A_add_timezone;
 
--- uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName
-drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName;
-delimiter d//
-CREATE PROCEDURE uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName()
-BEGIN
-    IF EXISTS (SELECT 1 FROM information_schema.STATISTICS
-                   WHERE TABLE_NAME='t_ds_task_definition'
-                     AND TABLE_SCHEMA=(SELECT DATABASE())
-                     AND INDEX_NAME ='task_unique')
-        ALTER TABLE t_ds_task_definition drop INDEX `task_unique`;
-    END IF;
-END;
-
-d//
-
-delimiter ;
-CALL uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName();
-DROP PROCEDURE uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName;
-
 -- ----------------------------
 -- Table structure for t_ds_environment
 -- ----------------------------
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 e85e008..723fcc2 100644
--- a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
+++ b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
@@ -364,6 +364,9 @@ comment on column t_ds_task_instance.environment_code is 'environment code';
 ALTER TABLE t_ds_task_instance ADD COLUMN environment_config text;
 comment on column t_ds_task_instance.environment_config is 'environment config';
 
+ALTER TABLE t_ds_task_definition ALTER COLUMN resource_ids TYPE text;
+ALTER TABLE t_ds_task_definition_log ALTER COLUMN resource_ids TYPE text;
+
 --
 -- Table structure for table t_ds_environment_worker_group_relation
 --
@@ -379,27 +382,6 @@ CREATE TABLE t_ds_environment_worker_group_relation (
     CONSTRAINT environment_worker_group_unique UNIQUE (environment_code,worker_group)
 );
 
--- uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName
-delimiter d//
-CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName() RETURNS void AS $$
-BEGIN
-    IF EXISTS (SELECT 1 FROM pg_stat_all_indexes
-          WHERE relname='t_ds_task_definition'
-                            AND indexrelname ='task_definition_unique')
-        ALTER TABLE t_ds_task_definition drop CONSTRAINT task_definition_unique;
-    END IF;
-END;
-$$ LANGUAGE plpgsql;
-d//
-
-delimiter ;
-SELECT uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName();
-DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName();
-
-
-ALTER TABLE t_ds_task_definition ALTER COLUMN resource_ids TYPE text;
-ALTER TABLE t_ds_task_definition_log ALTER COLUMN resource_ids TYPE text;
-
 -- ----------------------------
 -- 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
 -- ----------------------------