From dbc9f149b5790d8421564e16be6a3c9e8bfdfda2 Mon Sep 17 00:00:00 2001 From: lgcareer <18610854716@163.com> Date: Thu, 15 Oct 2020 17:52:45 +0800 Subject: [PATCH] [Fix-#3487][sql] update uc_dolphin_T_t_ds_resources_un --- .../postgresql/dolphinscheduler_ddl.sql | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sql/upgrade/1.3.3_schema/postgresql/dolphinscheduler_ddl.sql b/sql/upgrade/1.3.3_schema/postgresql/dolphinscheduler_ddl.sql index 59b913be99..bb7d9f0d03 100644 --- a/sql/upgrade/1.3.3_schema/postgresql/dolphinscheduler_ddl.sql +++ b/sql/upgrade/1.3.3_schema/postgresql/dolphinscheduler_ddl.sql @@ -16,18 +16,19 @@ */ -- add t_ds_resources_un +delimiter d// CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_resources_un() RETURNS void AS $$ BEGIN - IF NOT EXISTS ( - SELECT 1 FROM information_schema.KEY_COLUMN_USAGE - WHERE TABLE_NAME = 't_ds_resources' - AND CONSTRAINT_NAME = 't_ds_resources_un' - ) + IF NOT EXISTS (SELECT 1 FROM information_schema.KEY_COLUMN_USAGE + WHERE TABLE_NAME = 't_ds_resources' + AND CONSTRAINT_NAME = 't_ds_resources_un') THEN -ALTER TABLE t_ds_resources ADD CONSTRAINT t_ds_resources_un UNIQUE (full_name,"type"); -END IF; + ALTER TABLE t_ds_resources ADD CONSTRAINT t_ds_resources_un UNIQUE (full_name,"type"); + END IF; END; $$ LANGUAGE plpgsql; +d// +delimiter ; SELECT uc_dolphin_T_t_ds_resources_un(); DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_resources_un();