Repository: hive
Updated Branches:
  refs/heads/master f63124188 -> fb85336f7


HIVE-18220 : Workload Management tables have broken constraints defined on 
postgres schema (Deepesh Khandelwal, reviewed by Sergey Shelukhin)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/fb85336f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/fb85336f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/fb85336f

Branch: refs/heads/master
Commit: fb85336f703ceb1318fed172a3b8fec2b7ce16ca
Parents: f631241
Author: sergey <ser...@apache.org>
Authored: Tue Dec 5 13:05:24 2017 -0800
Committer: sergey <ser...@apache.org>
Committed: Tue Dec 5 13:05:24 2017 -0800

----------------------------------------------------------------------
 .../scripts/upgrade/postgres/hive-schema-3.0.0.postgres.sql | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fb85336f/metastore/scripts/upgrade/postgres/hive-schema-3.0.0.postgres.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/postgres/hive-schema-3.0.0.postgres.sql 
b/metastore/scripts/upgrade/postgres/hive-schema-3.0.0.postgres.sql
index 065974f..415b5e0 100644
--- a/metastore/scripts/upgrade/postgres/hive-schema-3.0.0.postgres.sql
+++ b/metastore/scripts/upgrade/postgres/hive-schema-3.0.0.postgres.sql
@@ -1010,7 +1010,7 @@ ALTER TABLE ONLY "METASTORE_DB_PROPERTIES"
 ALTER TABLE ONLY "WM_RESOURCEPLAN"
     ADD CONSTRAINT "WM_RESOURCEPLAN_pkey" PRIMARY KEY ("RP_ID");
 
-ALTER TABLE ONLY "WM_POOL"
+ALTER TABLE ONLY "WM_RESOURCEPLAN"
     ADD CONSTRAINT "UNIQUE_WM_RESOURCEPLAN" UNIQUE ("NAME");
 
 ALTER TABLE ONLY "WM_POOL"
@@ -1544,14 +1544,11 @@ ALTER TABLE ONLY "FUNC_RU"
 
 -- Resource plan FK constraints.
 
-ALTER TABLE ONLY "WM_RESOURCEPLAN"
-    ADD CONSTRAINT "WM_RESOURCEPLAN_FK1" FOREIGN KEY ("DEFAULT_POOL_ID") 
REFERENCES "WM_POOL" ("POOL_ID") DEFERRABLE;
-
 ALTER TABLE ONLY "WM_POOL"
     ADD CONSTRAINT "WM_POOL_FK1" FOREIGN KEY ("RP_ID") REFERENCES 
"WM_RESOURCEPLAN" ("RP_ID") DEFERRABLE;
 
-ALTER TABLE ONLY "WM_POOL"
-    ADD CONSTRAINT "WM_POOL_FK2" FOREIGN KEY ("PARENT_POOL_ID") REFERENCES 
"WM_POOL" ("POOL_ID") DEFERRABLE;
+ALTER TABLE ONLY "WM_RESOURCEPLAN"
+    ADD CONSTRAINT "WM_RESOURCEPLAN_FK1" FOREIGN KEY ("DEFAULT_POOL_ID") 
REFERENCES "WM_POOL" ("POOL_ID") DEFERRABLE;
 
 ALTER TABLE ONLY "WM_TRIGGER"
     ADD CONSTRAINT "WM_TRIGGER_FK1" FOREIGN KEY ("RP_ID") REFERENCES 
"WM_RESOURCEPLAN" ("RP_ID") DEFERRABLE;

Reply via email to