You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by we...@apache.org on 2024/05/16 07:41:14 UTC
(dolphinscheduler) 01/01: Fix PG database schema change incorrect 2.3.9
This is an automated email from the ASF dual-hosted git repository.
wenjun pushed a commit to branch dev_wenjun_fixPGSyncDev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
commit b61b4ed0e2880ba61fb5b1e867c3990d7b79bca3
Author: Wenjun Ruan <we...@apache.org>
AuthorDate: Thu May 16 13:53:16 2024 +0800
Fix PG database schema change incorrect 2.3.9
(cherry picked from commit ef40949a50359e6df9af6b3d86714e1a8eed117b)
---
.../src/main/resources/sql/dolphinscheduler_postgresql.sql | 1 -
.../sql/upgrade/3.0.0_schema/postgresql/dolphinscheduler_ddl.sql | 3 +--
.../src/test/resources/3.0.0_schema/postgresql_3.0.0.sql | 1 -
3 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
index 2d224092c4..b4865597b0 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
@@ -691,7 +691,6 @@ CREATE TABLE t_ds_relation_project_user (
PRIMARY KEY (id),
CONSTRAINT t_ds_relation_project_user_un UNIQUE (user_id, project_id)
) ;
-create index relation_project_user_id_index on t_ds_relation_project_user (user_id);
--
-- Table structure for table t_ds_relation_resources_user
diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.0.0_schema/postgresql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.0.0_schema/postgresql/dolphinscheduler_ddl.sql
index fbc9b26b86..51084a6654 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.0.0_schema/postgresql/dolphinscheduler_ddl.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.0.0_schema/postgresql/dolphinscheduler_ddl.sql
@@ -40,8 +40,7 @@ ALTER TABLE t_ds_alert ADD COLUMN IF NOT EXISTS "process_instance_id" int DEFAUL
ALTER TABLE t_ds_alert ADD COLUMN IF NOT EXISTS "alert_type" int DEFAULT NULL;
--- Add unique key
-
-CREATE INDEX IF NOT EXISTS t_ds_relation_project_user_un on t_ds_relation_project_user (user_id, project_id);
+ALTER TABLE "t_ds_relation_project_user" ADD CONSTRAINT "t_ds_relation_project_user_un" UNIQUE ("user_id", "project_id");
CREATE UNIQUE INDEX IF NOT EXISTS unique_name on t_ds_project (name);
CREATE UNIQUE INDEX IF NOT EXISTS unique_code on t_ds_project (code);
CREATE UNIQUE INDEX IF NOT EXISTS unique_queue_name on t_ds_queue (queue_name);
diff --git a/dolphinscheduler-tools/src/test/resources/3.0.0_schema/postgresql_3.0.0.sql b/dolphinscheduler-tools/src/test/resources/3.0.0_schema/postgresql_3.0.0.sql
index 4b0cae0c2f..102ce8a7f9 100644
--- a/dolphinscheduler-tools/src/test/resources/3.0.0_schema/postgresql_3.0.0.sql
+++ b/dolphinscheduler-tools/src/test/resources/3.0.0_schema/postgresql_3.0.0.sql
@@ -630,7 +630,6 @@ CREATE TABLE t_ds_relation_project_user (
PRIMARY KEY (id),
CONSTRAINT t_ds_relation_project_user_un UNIQUE (user_id, project_id)
) ;
-create index relation_project_user_id_index on t_ds_relation_project_user (user_id);
--
-- Table structure for table t_ds_relation_resources_user