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();