sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject [16/51] [partial] sentry git commit: SENTRY-1205: Refactor the code for sentry-provider-db and create sentry-service module(Colin Ma, reviewed by Dapeng Sun)
Date Thu, 21 Jul 2016 05:55:10 GMT
http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.derby.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.derby.sql b/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.derby.sql
deleted file mode 100644
index c038b81..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.derby.sql
+++ /dev/null
@@ -1,43 +0,0 @@
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1) NOT NULL DEFAULT 'N',
-    RESOURCE_NAME_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_3 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_3 VARCHAR(400) DEFAULT '__NULL__',
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);
-
-

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.mysql.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.mysql.sql b/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.mysql.sql
deleted file mode 100644
index 920737f..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.mysql.sql
+++ /dev/null
@@ -1,62 +0,0 @@
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE `SENTRY_GM_PRIVILEGE`
-(
-    `GM_PRIVILEGE_ID` BIGINT NOT NULL,
-    `ACTION` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-    `COMPONENT_NAME` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-    `CREATE_TIME` BIGINT NOT NULL,
-    `WITH_GRANT_OPTION` CHAR(1) NOT NULL DEFAULT 'N',
-    `RESOURCE_NAME_0` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `RESOURCE_NAME_1` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `RESOURCE_NAME_2` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `RESOURCE_NAME_3` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `RESOURCE_TYPE_0` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `RESOURCE_TYPE_1` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `RESOURCE_TYPE_2` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `RESOURCE_TYPE_3` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '__NULL__',
-    `SCOPE` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-    `SERVICE_NAME` VARCHAR(64) BINARY CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
-) ENGINE=INNODB DEFAULT CHARSET=utf8;
-
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD CONSTRAINT `SENTRY_GM_PRIVILEGE_PK` PRIMARY KEY (`GM_PRIVILEGE_ID`);
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD UNIQUE `GM_PRIVILEGE_UNIQUE` (`COMPONENT_NAME`,`SERVICE_NAME`,`RESOURCE_NAME_0`,`RESOURCE_TYPE_0`,`RESOURCE_NAME_1`,`RESOURCE_TYPE_1`,`RESOURCE_NAME_2`,`RESOURCE_TYPE_2`,`RESOURCE_NAME_3`,`RESOURCE_TYPE_3`,`ACTION`,`WITH_GRANT_OPTION`);
-
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD INDEX `SENTRY_GM_PRIV_COMP_IDX` (`COMPONENT_NAME`);
-
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD INDEX `SENTRY_GM_PRIV_SERV_IDX` (`SERVICE_NAME`);
-
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD INDEX `SENTRY_GM_PRIV_RES0_IDX` (`RESOURCE_NAME_0`,`RESOURCE_TYPE_0`);
-
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD INDEX `SENTRY_GM_PRIV_RES1_IDX` (`RESOURCE_NAME_1`,`RESOURCE_TYPE_1`);
-
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD INDEX `SENTRY_GM_PRIV_RES2_IDX` (`RESOURCE_NAME_2`,`RESOURCE_TYPE_2`);
-
-ALTER TABLE `SENTRY_GM_PRIVILEGE`
-  ADD INDEX `SENTRY_GM_PRIV_RES3_IDX` (`RESOURCE_NAME_3`,`RESOURCE_TYPE_3`);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE `SENTRY_ROLE_GM_PRIVILEGE_MAP`
-(
-    `ROLE_ID` BIGINT NOT NULL,
-    `GM_PRIVILEGE_ID` BIGINT NOT NULL
-) ENGINE=INNODB DEFAULT CHARSET=utf8;
-
-ALTER TABLE `SENTRY_ROLE_GM_PRIVILEGE_MAP`
-  ADD CONSTRAINT `SENTRY_ROLE_GM_PRIVILEGE_MAP_PK` PRIMARY KEY (`ROLE_ID`,`GM_PRIVILEGE_ID`);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-ALTER TABLE `SENTRY_ROLE_GM_PRIVILEGE_MAP`
-  ADD CONSTRAINT `SEN_RLE_GM_PRV_MAP_SN_RLE_FK`
-  FOREIGN KEY (`ROLE_ID`) REFERENCES `SENTRY_ROLE`(`ROLE_ID`);
-
-ALTER TABLE `SENTRY_ROLE_GM_PRIVILEGE_MAP`
-  ADD CONSTRAINT `SEN_RL_GM_PRV_MAP_SN_DB_PRV_FK`
-  FOREIGN KEY (`GM_PRIVILEGE_ID`) REFERENCES `SENTRY_GM_PRIVILEGE`(`GM_PRIVILEGE_ID`);

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.oracle.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.oracle.sql b/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.oracle.sql
deleted file mode 100644
index 412bc45..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.oracle.sql
+++ /dev/null
@@ -1,55 +0,0 @@
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE "SENTRY_GM_PRIVILEGE" (
-  "GM_PRIVILEGE_ID" NUMBER NOT NULL,
-  "COMPONENT_NAME" VARCHAR2(32) NOT NULL,
-  "CREATE_TIME" NUMBER NOT NULL,
-  "WITH_GRANT_OPTION" CHAR(1) DEFAULT 'N' NOT NULL,
-  "RESOURCE_NAME_0" VARCHAR2(64) DEFAULT '__NULL__',
-  "RESOURCE_NAME_1" VARCHAR2(64) DEFAULT '__NULL__',
-  "RESOURCE_NAME_2" VARCHAR2(64) DEFAULT '__NULL__',
-  "RESOURCE_NAME_3" VARCHAR2(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_0" VARCHAR2(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_1" VARCHAR2(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_2" VARCHAR2(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_3" VARCHAR2(64) DEFAULT '__NULL__',
-  "ACTION" VARCHAR2(32) NOT NULL,
-  "SCOPE" VARCHAR2(128) NOT NULL,
-  "SERVICE_NAME" VARCHAR2(64) NOT NULL
-);
-
-ALTER TABLE "SENTRY_GM_PRIVILEGE"
-  ADD CONSTRAINT "SENTRY_GM_PRIV_PK" PRIMARY KEY ("GM_PRIVILEGE_ID");
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-ALTER TABLE "SENTRY_GM_PRIVILEGE"
-  ADD CONSTRAINT "SENTRY_GM_PRIV_PRIV_NAME_UNIQ" UNIQUE ("COMPONENT_NAME","SERVICE_NAME","RESOURCE_NAME_0","RESOURCE_NAME_1","RESOURCE_NAME_2",
-  "RESOURCE_NAME_3","RESOURCE_TYPE_0","RESOURCE_TYPE_1","RESOURCE_TYPE_2","RESOURCE_TYPE_3","ACTION","WITH_GRANT_OPTION");
-
-CREATE INDEX "SENTRY_GM_PRIV_COMP_IDX" ON "SENTRY_GM_PRIVILEGE" ("COMPONENT_NAME");
-
-CREATE INDEX "SENTRY_GM_PRIV_SERV_IDX" ON "SENTRY_GM_PRIVILEGE" ("SERVICE_NAME");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES0_IDX" ON "SENTRY_GM_PRIVILEGE" ("RESOURCE_NAME_0","RESOURCE_TYPE_0");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES1_IDX" ON "SENTRY_GM_PRIVILEGE" ("RESOURCE_NAME_1","RESOURCE_TYPE_1");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES2_IDX" ON "SENTRY_GM_PRIVILEGE" ("RESOURCE_NAME_2","RESOURCE_TYPE_2");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES3_IDX" ON "SENTRY_GM_PRIVILEGE" ("RESOURCE_NAME_3","RESOURCE_TYPE_3");
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE "SENTRY_ROLE_GM_PRIVILEGE_MAP" (
-  "ROLE_ID" NUMBER NOT NULL,
-  "GM_PRIVILEGE_ID" NUMBER NOT NULL
-);
-
-ALTER TABLE "SENTRY_ROLE_GM_PRIVILEGE_MAP"
-  ADD CONSTRAINT "SEN_RLE_GM_PRIV_MAP_PK" PRIMARY KEY ("ROLE_ID","GM_PRIVILEGE_ID");
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-ALTER TABLE "SENTRY_ROLE_GM_PRIVILEGE_MAP"
-  ADD CONSTRAINT "SEN_RLE_GM_PRV_MAP_SN_RLE_FK"
-  FOREIGN KEY ("ROLE_ID") REFERENCES "SENTRY_ROLE"("ROLE_ID") INITIALLY DEFERRED;
-
-ALTER TABLE "SENTRY_ROLE_GM_PRIVILEGE_MAP"
-  ADD CONSTRAINT "SEN_RL_GM_PRV_MAP_SN_DB_PRV_FK"
-  FOREIGN KEY ("GM_PRIVILEGE_ID") REFERENCES "SENTRY_GM_PRIVILEGE"("GM_PRIVILEGE_ID") INITIALLY DEFERRED;

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.postgres.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.postgres.sql b/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.postgres.sql
deleted file mode 100644
index e9e1655..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/005-SENTRY-398.postgres.sql
+++ /dev/null
@@ -1,54 +0,0 @@
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE "SENTRY_GM_PRIVILEGE" (
-  "GM_PRIVILEGE_ID" BIGINT NOT NULL,
-  "COMPONENT_NAME" character varying(32) NOT NULL,
-  "CREATE_TIME" BIGINT NOT NULL,
-  "WITH_GRANT_OPTION" CHAR(1) NOT NULL DEFAULT 'N',
-  "RESOURCE_NAME_0" character varying(64) DEFAULT '__NULL__',
-  "RESOURCE_NAME_1" character varying(64) DEFAULT '__NULL__',
-  "RESOURCE_NAME_2" character varying(64) DEFAULT '__NULL__',
-  "RESOURCE_NAME_3" character varying(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_0" character varying(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_1" character varying(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_2" character varying(64) DEFAULT '__NULL__',
-  "RESOURCE_TYPE_3" character varying(64) DEFAULT '__NULL__',
-  "ACTION" character varying(32) NOT NULL,
-  "SCOPE" character varying(128) NOT NULL,
-  "SERVICE_NAME" character varying(64) NOT NULL
-);
-ALTER TABLE ONLY "SENTRY_GM_PRIVILEGE"
-  ADD CONSTRAINT "SENTRY_GM_PRIV_PK" PRIMARY KEY ("GM_PRIVILEGE_ID");
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-ALTER TABLE ONLY "SENTRY_GM_PRIVILEGE"
-  ADD CONSTRAINT "SENTRY_GM_PRIV_PRIV_NAME_UNIQ" UNIQUE ("COMPONENT_NAME","SERVICE_NAME","RESOURCE_NAME_0","RESOURCE_NAME_1","RESOURCE_NAME_2",
-  "RESOURCE_NAME_3","RESOURCE_TYPE_0","RESOURCE_TYPE_1","RESOURCE_TYPE_2","RESOURCE_TYPE_3","ACTION","WITH_GRANT_OPTION");
-
-CREATE INDEX "SENTRY_GM_PRIV_COMP_IDX" ON "SENTRY_GM_PRIVILEGE" USING btree ("COMPONENT_NAME");
-
-CREATE INDEX "SENTRY_GM_PRIV_SERV_IDX" ON "SENTRY_GM_PRIVILEGE" USING btree ("SERVICE_NAME");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES0_IDX" ON "SENTRY_GM_PRIVILEGE" USING btree ("RESOURCE_NAME_0","RESOURCE_TYPE_0");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES1_IDX" ON "SENTRY_GM_PRIVILEGE" USING btree ("RESOURCE_NAME_1","RESOURCE_TYPE_1");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES2_IDX" ON "SENTRY_GM_PRIVILEGE" USING btree ("RESOURCE_NAME_2","RESOURCE_TYPE_2");
-
-CREATE INDEX "SENTRY_GM_PRIV_RES3_IDX" ON "SENTRY_GM_PRIVILEGE" USING btree ("RESOURCE_NAME_3","RESOURCE_TYPE_3");
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE "SENTRY_ROLE_GM_PRIVILEGE_MAP" (
-  "ROLE_ID" BIGINT NOT NULL,
-  "GM_PRIVILEGE_ID" BIGINT NOT NULL
-);
-
-ALTER TABLE "SENTRY_ROLE_GM_PRIVILEGE_MAP"
-  ADD CONSTRAINT "SENTRY_ROLE_GM_PRIVILEGE_MAP_PK" PRIMARY KEY ("ROLE_ID","GM_PRIVILEGE_ID");
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-ALTER TABLE ONLY "SENTRY_ROLE_GM_PRIVILEGE_MAP"
-  ADD CONSTRAINT "SEN_RLE_GM_PRV_MAP_SN_RLE_FK"
-  FOREIGN KEY ("ROLE_ID") REFERENCES "SENTRY_ROLE"("ROLE_ID") DEFERRABLE;
-
-ALTER TABLE ONLY "SENTRY_ROLE_GM_PRIVILEGE_MAP"
-  ADD CONSTRAINT "SEN_RL_GM_PRV_MAP_SN_DB_PRV_FK"
-  FOREIGN KEY ("GM_PRIVILEGE_ID") REFERENCES "SENTRY_GM_PRIVILEGE"("GM_PRIVILEGE_ID") DEFERRABLE;

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.derby.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.derby.sql b/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.derby.sql
deleted file mode 100644
index 807a62b..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.derby.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-CREATE TABLE SENTRY_USER
-(
-    USER_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    USER_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_USER ADD CONSTRAINT SENTRY_USER_PK PRIMARY KEY (USER_ID);
-
-CREATE UNIQUE INDEX SENTRYUSERNAME ON SENTRY_USER (USER_NAME);
-
-CREATE TABLE SENTRY_ROLE_USER_MAP
-(
-    USER_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_USER_MAP ADD CONSTRAINT SENTRY_ROLE_USER_MAP_PK PRIMARY KEY (USER_ID,ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_USER_MAP_N49 ON SENTRY_ROLE_USER_MAP (USER_ID);
-
-CREATE INDEX SENTRY_ROLE_USER_MAP_N50 ON SENTRY_ROLE_USER_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_USER_MAP ADD CONSTRAINT SENTRY_ROLE_USER_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_USER_MAP ADD CONSTRAINT SENTRY_ROLE_USER_MAP_FK1 FOREIGN KEY (USER_ID) REFERENCES SENTRY_USER (USER_ID) ;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.mysql.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.mysql.sql b/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.mysql.sql
deleted file mode 100644
index b3a9828..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.mysql.sql
+++ /dev/null
@@ -1,28 +0,0 @@
-CREATE TABLE `SENTRY_USER` (
-	  `USER_ID` BIGINT  NOT NULL,
-	  `USER_NAME` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-	  `CREATE_TIME` BIGINT NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-ALTER TABLE `SENTRY_USER`
-	 ADD CONSTRAINT `SENTRY_USER_PK` PRIMARY KEY (`USER_ID`);
-
-ALTER TABLE `SENTRY_USER`
-	 ADD CONSTRAINT `SENTRY_USER_USER_NAME_UNIQUE` UNIQUE (`USER_NAME`);
-
-CREATE TABLE `SENTRY_ROLE_USER_MAP` (
-	  `ROLE_ID` BIGINT NOT NULL,
-	  `USER_ID` BIGINT NOT NULL,
-	  `GRANTOR_PRINCIPAL` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_bin
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-ALTER TABLE `SENTRY_ROLE_USER_MAP`
-	ADD CONSTRAINT `SENTRY_ROLE_USER_MAP_PK` PRIMARY KEY (`ROLE_ID`,`USER_ID`);
-
-ALTER TABLE `SENTRY_ROLE_USER_MAP`
-	ADD CONSTRAINT `SEN_ROLE_USER_MAP_SEN_ROLE_FK`
-	FOREIGN KEY (`ROLE_ID`) REFERENCES `SENTRY_ROLE`(`ROLE_ID`);
-
-ALTER TABLE `SENTRY_ROLE_USER_MAP`
-	 ADD CONSTRAINT `SEN_ROLE_USER_MAP_SEN_USER_FK`
-	 FOREIGN KEY (`USER_ID`) REFERENCES `SENTRY_USER`(`USER_ID`);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.oracle.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.oracle.sql b/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.oracle.sql
deleted file mode 100644
index 76ae0d5..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.oracle.sql
+++ /dev/null
@@ -1,28 +0,0 @@
-CREATE TABLE "SENTRY_USER" (
-  "USER_ID" NUMBER  NOT NULL,
-  "USER_NAME" VARCHAR2(128) NOT NULL,
-  "CREATE_TIME" NUMBER NOT NULL
-);
-
-ALTER TABLE "SENTRY_USER"
-  ADD CONSTRAINT "SENTRY_USER_PK" PRIMARY KEY ("USER_ID");
-
-ALTER TABLE "SENTRY_USER"
-  ADD CONSTRAINT "SENTRY_USER_USER_NAME_UNIQUE" UNIQUE ("USER_NAME");
-
-CREATE TABLE "SENTRY_ROLE_USER_MAP" (
-  "ROLE_ID" NUMBER NOT NULL,
-  "USER_ID" NUMBER NOT NULL,
-  "GRANTOR_PRINCIPAL" VARCHAR2(128)
-);
-
-ALTER TABLE "SENTRY_ROLE_USER_MAP"
-  ADD CONSTRAINT "SENTRY_ROLE_USER_MAP_PK" PRIMARY KEY ("ROLE_ID","USER_ID");
-
-ALTER TABLE "SENTRY_ROLE_USER_MAP"
-  ADD CONSTRAINT "SEN_ROLE_USER_MAP_SEN_ROLE_FK"
-  FOREIGN KEY ("ROLE_ID") REFERENCES "SENTRY_ROLE"("ROLE_ID") INITIALLY DEFERRED;
-
-ALTER TABLE "SENTRY_ROLE_USER_MAP"
-  ADD CONSTRAINT "SEN_ROLE_USER_MAP_SEN_USER_FK"
-  FOREIGN KEY ("USER_ID") REFERENCES "SENTRY_USER"("USER_ID") INITIALLY DEFERRED;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.postgres.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.postgres.sql b/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.postgres.sql
deleted file mode 100644
index 37e8abc..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/006-SENTRY-711.postgres.sql
+++ /dev/null
@@ -1,28 +0,0 @@
-CREATE TABLE "SENTRY_USER" (
-  "USER_ID" BIGINT  NOT NULL,
-  "USER_NAME" character varying(128) NOT NULL,
-  "CREATE_TIME" BIGINT NOT NULL
-);
-
-ALTER TABLE ONLY "SENTRY_USER"
-  ADD CONSTRAINT "SENTRY_USER_PK" PRIMARY KEY ("USER_ID");
-
-ALTER TABLE ONLY "SENTRY_USER"
-  ADD CONSTRAINT "SENTRY_USER_USER_NAME_UNIQUE" UNIQUE ("USER_NAME");
-
-CREATE TABLE "SENTRY_ROLE_USER_MAP" (
-  "ROLE_ID" BIGINT NOT NULL,
-  "USER_ID" BIGINT NOT NULL,
-  "GRANTOR_PRINCIPAL" character varying(128)
-);
-
-ALTER TABLE "SENTRY_ROLE_USER_MAP"
-  ADD CONSTRAINT "SENTRY_ROLE_USER_MAP_PK" PRIMARY KEY ("ROLE_ID","USER_ID");
-
-ALTER TABLE ONLY "SENTRY_ROLE_USER_MAP"
-  ADD CONSTRAINT "SEN_ROLE_USER_MAP_SEN_ROLE_FK"
-  FOREIGN KEY ("ROLE_ID") REFERENCES "SENTRY_ROLE"("ROLE_ID") DEFERRABLE;
-
-ALTER TABLE ONLY "SENTRY_ROLE_USER_MAP"
-  ADD CONSTRAINT "SEN_ROLE_USER_MAP_SEN_USER_FK"
-  FOREIGN KEY ("USER_ID") REFERENCES "SENTRY_USER"("USER_ID") DEFERRABLE;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.4.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.4.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.4.0.sql
deleted file mode 100644
index f2a62d2..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.4.0.sql
+++ /dev/null
@@ -1,112 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000),
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000),
-    GRANTOR_PRINCIPAL VARCHAR(4000),
-    PRIVILEGE_NAME VARCHAR(4000),
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000)
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(4000),
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(4000),
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE (PRIVILEGE_NAME);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.4.0', 'Sentry release version 1.4.0');

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.5.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.5.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.5.0.sql
deleted file mode 100644
index 53b163a..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.5.0.sql
+++ /dev/null
@@ -1,155 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000),
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000),
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000),
-    "COLUMN_NAME" VARCHAR(4000),
-    WITH_GRANT_OPTION CHAR(1) NOT NULL
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE ("SERVER_NAME",DB_NAME,"TABLE_NAME","COLUMN_NAME",URI,"ACTION",WITH_GRANT_OPTION);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.5.0', 'Sentry release version 1.5.0');
-
--- Generic model
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1),
-    RESOURCE_NAME_0 VARCHAR(400),
-    RESOURCE_NAME_1 VARCHAR(400),
-    RESOURCE_NAME_2 VARCHAR(400),
-    RESOURCE_NAME_3 VARCHAR(400),
-    RESOURCE_TYPE_0 VARCHAR(400),
-    RESOURCE_TYPE_1 VARCHAR(400),
-    RESOURCE_TYPE_2 VARCHAR(400),
-    RESOURCE_TYPE_3 VARCHAR(400),
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.6.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.6.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.6.0.sql
deleted file mode 100644
index 0f8f0af..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.6.0.sql
+++ /dev/null
@@ -1,155 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000),
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000),
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000),
-    "COLUMN_NAME" VARCHAR(4000),
-    WITH_GRANT_OPTION CHAR(1) NOT NULL
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE ("SERVER_NAME",DB_NAME,"TABLE_NAME","COLUMN_NAME",URI,"ACTION",WITH_GRANT_OPTION);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.6.0', 'Sentry release version 1.6.0');
-
--- Generic model
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1),
-    RESOURCE_NAME_0 VARCHAR(400),
-    RESOURCE_NAME_1 VARCHAR(400),
-    RESOURCE_NAME_2 VARCHAR(400),
-    RESOURCE_NAME_3 VARCHAR(400),
-    RESOURCE_TYPE_0 VARCHAR(400),
-    RESOURCE_TYPE_1 VARCHAR(400),
-    RESOURCE_TYPE_2 VARCHAR(400),
-    RESOURCE_TYPE_3 VARCHAR(400),
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.7.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.7.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.7.0.sql
deleted file mode 100644
index b1e8649..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.7.0.sql
+++ /dev/null
@@ -1,155 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000),
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000),
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000),
-    "COLUMN_NAME" VARCHAR(4000),
-    WITH_GRANT_OPTION CHAR(1) NOT NULL
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE ("SERVER_NAME",DB_NAME,"TABLE_NAME","COLUMN_NAME",URI,"ACTION",WITH_GRANT_OPTION);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.7.0', 'Sentry release version 1.7.0');
-
--- Generic model
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1),
-    RESOURCE_NAME_0 VARCHAR(400),
-    RESOURCE_NAME_1 VARCHAR(400),
-    RESOURCE_NAME_2 VARCHAR(400),
-    RESOURCE_NAME_3 VARCHAR(400),
-    RESOURCE_TYPE_0 VARCHAR(400),
-    RESOURCE_TYPE_1 VARCHAR(400),
-    RESOURCE_TYPE_2 VARCHAR(400),
-    RESOURCE_TYPE_3 VARCHAR(400),
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql
deleted file mode 100644
index 6d08b5c..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql
+++ /dev/null
@@ -1,183 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000),
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000),
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000),
-    "COLUMN_NAME" VARCHAR(4000),
-    WITH_GRANT_OPTION CHAR(1) NOT NULL
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE ("SERVER_NAME",DB_NAME,"TABLE_NAME","COLUMN_NAME",URI,"ACTION",WITH_GRANT_OPTION);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.8.0', 'Sentry release version 1.8.0');
-
--- Generic model
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1),
-    RESOURCE_NAME_0 VARCHAR(400),
-    RESOURCE_NAME_1 VARCHAR(400),
-    RESOURCE_NAME_2 VARCHAR(400),
-    RESOURCE_NAME_3 VARCHAR(400),
-    RESOURCE_TYPE_0 VARCHAR(400),
-    RESOURCE_TYPE_1 VARCHAR(400),
-    RESOURCE_TYPE_2 VARCHAR(400),
-    RESOURCE_TYPE_3 VARCHAR(400),
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);
-
-CREATE TABLE SENTRY_USER
-(
-    USER_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    USER_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_USER ADD CONSTRAINT SENTRY_USER_PK PRIMARY KEY (USER_ID);
-
-CREATE UNIQUE INDEX SENTRYUSERNAME ON SENTRY_USER (USER_NAME);
-
-CREATE TABLE SENTRY_ROLE_USER_MAP
-(
-    USER_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_USER_MAP ADD CONSTRAINT SENTRY_ROLE_USER_MAP_PK PRIMARY KEY (USER_ID,ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_USER_MAP_N49 ON SENTRY_ROLE_USER_MAP (USER_ID);
-
-CREATE INDEX SENTRY_ROLE_USER_MAP_N50 ON SENTRY_ROLE_USER_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_USER_MAP ADD CONSTRAINT SENTRY_ROLE_USER_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_USER_MAP ADD CONSTRAINT SENTRY_ROLE_USER_MAP_FK1 FOREIGN KEY (USER_ID) REFERENCES SENTRY_USER (USER_ID) ;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.4.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.4.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.4.0.sql
deleted file mode 100644
index f2a62d2..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.4.0.sql
+++ /dev/null
@@ -1,112 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000),
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000),
-    GRANTOR_PRINCIPAL VARCHAR(4000),
-    PRIVILEGE_NAME VARCHAR(4000),
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000)
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(4000),
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(4000),
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE (PRIVILEGE_NAME);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.4.0', 'Sentry release version 1.4.0');

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.5.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.5.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.5.0.sql
deleted file mode 100644
index 89d73bb..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.5.0.sql
+++ /dev/null
@@ -1,155 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000) DEFAULT '__NULL__',
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000) DEFAULT '__NULL__',
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000) DEFAULT '__NULL__',
-    "COLUMN_NAME" VARCHAR(4000) DEFAULT '__NULL__',
-    WITH_GRANT_OPTION CHAR(1) NOT NULL
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE ("SERVER_NAME",DB_NAME,"TABLE_NAME","COLUMN_NAME",URI,"ACTION",WITH_GRANT_OPTION);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.5.0', 'Sentry release version 1.5.0');
-
--- Generic Model
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1),
-    RESOURCE_NAME_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_3 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_3 VARCHAR(400) DEFAULT '__NULL__',
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.6.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.6.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.6.0.sql
deleted file mode 100644
index 9ceb4c5..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.6.0.sql
+++ /dev/null
@@ -1,155 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000) DEFAULT '__NULL__',
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000) DEFAULT '__NULL__',
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000) DEFAULT '__NULL__',
-    "COLUMN_NAME" VARCHAR(4000) DEFAULT '__NULL__',
-    WITH_GRANT_OPTION CHAR(1) NOT NULL
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE ("SERVER_NAME",DB_NAME,"TABLE_NAME","COLUMN_NAME",URI,"ACTION",WITH_GRANT_OPTION);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.6.0', 'Sentry release version 1.6.0');
-
--- Generic Model
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1),
-    RESOURCE_NAME_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_3 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_3 VARCHAR(400) DEFAULT '__NULL__',
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);

http://git-wip-us.apache.org/repos/asf/sentry/blob/f1332300/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.7.0.sql
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.7.0.sql b/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.7.0.sql
deleted file mode 100644
index b06fc4a..0000000
--- a/sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.7.0.sql
+++ /dev/null
@@ -1,155 +0,0 @@
---Licensed to the Apache Software Foundation (ASF) under one or more
---contributor license agreements.  See the NOTICE file distributed with
---this work for additional information regarding copyright ownership.
---The ASF licenses this file to You under the Apache License, Version 2.0
---(the "License"); you may not use this file except in compliance with
---the License.  You may obtain a copy of the License at
---
---    http://www.apache.org/licenses/LICENSE-2.0
---
---Unless required by applicable law or agreed to in writing, software
---distributed under the License is distributed on an "AS IS" BASIS,
---WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
---See the License for the specific language governing permissions and
---limitations under the License.
-
--- Table SENTRY_DB_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE TABLE SENTRY_DB_PRIVILEGE
-(
-    DB_PRIVILEGE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    URI VARCHAR(4000) DEFAULT '__NULL__',
-    "ACTION" VARCHAR(40),
-    CREATE_TIME BIGINT NOT NULL,
-    DB_NAME VARCHAR(4000) DEFAULT '__NULL__',
-    PRIVILEGE_SCOPE VARCHAR(40),
-    "SERVER_NAME" VARCHAR(4000),
-    "TABLE_NAME" VARCHAR(4000) DEFAULT '__NULL__',
-    "COLUMN_NAME" VARCHAR(4000) DEFAULT '__NULL__',
-    WITH_GRANT_OPTION CHAR(1) NOT NULL
-);
-
-ALTER TABLE SENTRY_DB_PRIVILEGE ADD CONSTRAINT SENTRY_DB_PRIVILEGE_PK PRIMARY KEY (DB_PRIVILEGE_ID);
-
--- Table SENTRY_ROLE for classes [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE TABLE SENTRY_ROLE
-(
-    ROLE_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    ROLE_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE ADD CONSTRAINT SENTRY_ROLE_PK PRIMARY KEY (ROLE_ID);
-
--- Table SENTRY_GROUP for classes [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE TABLE SENTRY_GROUP
-(
-    GROUP_ID BIGINT NOT NULL generated always as identity (start with 1),
-    CREATE_TIME BIGINT NOT NULL,
-    GROUP_NAME VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_GROUP ADD CONSTRAINT SENTRY_GROUP_PK PRIMARY KEY (GROUP_ID);
-
--- Table SENTRY_ROLE_GROUP_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GROUP_MAP
-(
-    GROUP_ID BIGINT NOT NULL,
-    ROLE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_PK PRIMARY KEY (GROUP_ID,ROLE_ID);
-
--- Table SENTRY_ROLE_DB_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    DB_PRIVILEGE_ID BIGINT NOT NULL,
-    GRANTOR_PRINCIPAL VARCHAR(128)
-);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,DB_PRIVILEGE_ID);
-
-CREATE TABLE "SENTRY_VERSION" (
-  VER_ID BIGINT NOT NULL,
-  SCHEMA_VERSION VARCHAR(127),
-  VERSION_COMMENT VARCHAR(255)
-);
-
-ALTER TABLE SENTRY_VERSION ADD CONSTRAINT SENTRY_VERSION_PK PRIMARY KEY (VER_ID);
-
--- Constraints for table SENTRY_DB_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryPrivilege]
-CREATE UNIQUE INDEX SENTRYPRIVILEGENAME ON SENTRY_DB_PRIVILEGE ("SERVER_NAME",DB_NAME,"TABLE_NAME","COLUMN_NAME",URI,"ACTION",WITH_GRANT_OPTION);
-
-
--- Constraints for table SENTRY_ROLE for class(es) [org.apache.sentry.provider.db.service.model.MSentryRole]
-CREATE UNIQUE INDEX SENTRYROLENAME ON SENTRY_ROLE (ROLE_NAME);
-
-
--- Constraints for table SENTRY_GROUP for class(es) [org.apache.sentry.provider.db.service.model.MSentryGroup]
-CREATE UNIQUE INDEX SENTRYGROUPNAME ON SENTRY_GROUP (GROUP_NAME);
-
-
--- Constraints for table SENTRY_ROLE_GROUP_MAP
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N49 ON SENTRY_ROLE_GROUP_MAP (GROUP_ID);
-
-CREATE INDEX SENTRY_ROLE_GROUP_MAP_N50 ON SENTRY_ROLE_GROUP_MAP (ROLE_ID);
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK2 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_GROUP_MAP ADD CONSTRAINT SENTRY_ROLE_GROUP_MAP_FK1 FOREIGN KEY (GROUP_ID) REFERENCES SENTRY_GROUP (GROUP_ID) ;
-
-
--- Constraints for table SENTRY_ROLE_DB_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_DB_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_DB_PRIVILEGE_MAP (DB_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK2 FOREIGN KEY (DB_PRIVILEGE_ID) REFERENCES SENTRY_DB_PRIVILEGE (DB_PRIVILEGE_ID) ;
-
-ALTER TABLE SENTRY_ROLE_DB_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_DB_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID) ;
-
-INSERT INTO SENTRY_VERSION (VER_ID, SCHEMA_VERSION, VERSION_COMMENT) VALUES (1, '1.7.0', 'Sentry release version 1.7.0');
-
--- Generic Model
--- Table SENTRY_GM_PRIVILEGE for classes [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE TABLE SENTRY_GM_PRIVILEGE
-(
-    GM_PRIVILEGE_ID BIGINT NOT NULL,
-    "ACTION" VARCHAR(40),
-    COMPONENT_NAME VARCHAR(400),
-    CREATE_TIME BIGINT NOT NULL,
-    WITH_GRANT_OPTION CHAR(1),
-    RESOURCE_NAME_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_NAME_3 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_0 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_1 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_2 VARCHAR(400) DEFAULT '__NULL__',
-    RESOURCE_TYPE_3 VARCHAR(400) DEFAULT '__NULL__',
-    "SCOPE" VARCHAR(40),
-    SERVICE_NAME VARCHAR(400)
-);
--- Primary key(GM_PRIVILEGE_ID)
-ALTER TABLE SENTRY_GM_PRIVILEGE ADD CONSTRAINT SENTRY_GM_PRIVILEGE_PK PRIMARY KEY (GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_GM_PRIVILEGE for class(es) [org.apache.sentry.provider.db.service.model.MSentryGMPrivilege]
-CREATE UNIQUE INDEX GM_PRIVILEGE_INDEX ON SENTRY_GM_PRIVILEGE (COMPONENT_NAME,SERVICE_NAME,RESOURCE_NAME_0,RESOURCE_TYPE_0,RESOURCE_NAME_1,RESOURCE_TYPE_1,RESOURCE_NAME_2,RESOURCE_TYPE_2,RESOURCE_NAME_3,RESOURCE_TYPE_3,"ACTION",WITH_GRANT_OPTION);
-
--- Table SENTRY_ROLE_GM_PRIVILEGE_MAP for join relationship
-CREATE TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP
-(
-    ROLE_ID BIGINT NOT NULL,
-    GM_PRIVILEGE_ID BIGINT NOT NULL
-);
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_PK PRIMARY KEY (ROLE_ID,GM_PRIVILEGE_ID);
-
--- Constraints for table SENTRY_ROLE_GM_PRIVILEGE_MAP
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N50 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (ROLE_ID);
-
-CREATE INDEX SENTRY_ROLE_GM_PRIVILEGE_MAP_N49 ON SENTRY_ROLE_GM_PRIVILEGE_MAP (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK2 FOREIGN KEY (GM_PRIVILEGE_ID) REFERENCES SENTRY_GM_PRIVILEGE (GM_PRIVILEGE_ID);
-
-ALTER TABLE SENTRY_ROLE_GM_PRIVILEGE_MAP ADD CONSTRAINT SENTRY_ROLE_GM_PRIVILEGE_MAP_FK1 FOREIGN KEY (ROLE_ID) REFERENCES SENTRY_ROLE (ROLE_ID);


Mime
View raw message