RANGER-1173: Improve Ranger database schema import logic and make it more robust

Signed-off-by: Velmurugan Periasamy <v...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/68541c92
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/68541c92
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/68541c92

Branch: refs/heads/master
Commit: 68541c92afe3b6500ef28b3a6ee01149a337ad20
Parents: 1115ca8
Author: pradeep agrawal <pradeep.agra...@freestoneinfotech.com>
Authored: Tue Sep 13 14:39:51 2016 +0530
Committer: Velmurugan Periasamy <v...@apache.org>
Committed: Tue Sep 13 10:38:22 2016 -0400

----------------------------------------------------------------------
 .../db/oracle/create_dbversion_catalog.sql      |    1 +
 security-admin/db/oracle/xa_core_db_oracle.sql  |    1 -
 security-admin/scripts/db_setup.py              | 1023 +++++++++++++++---
 3 files changed, 858 insertions(+), 167 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/68541c92/security-admin/db/oracle/create_dbversion_catalog.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/oracle/create_dbversion_catalog.sql 
b/security-admin/db/oracle/create_dbversion_catalog.sql
index 0017748..5820cc8 100644
--- a/security-admin/db/oracle/create_dbversion_catalog.sql
+++ b/security-admin/db/oracle/create_dbversion_catalog.sql
@@ -22,4 +22,5 @@ create table X_DB_VERSION_H  (
     updated_by VARCHAR(256) NOT NULL,
        active VARCHAR(1) DEFAULT 'Y'
 );
+CREATE SEQUENCE X_DB_VERSION_H_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 commit;

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/68541c92/security-admin/db/oracle/xa_core_db_oracle.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/oracle/xa_core_db_oracle.sql 
b/security-admin/db/oracle/xa_core_db_oracle.sql
index 2ede810..d377482 100644
--- a/security-admin/db/oracle/xa_core_db_oracle.sql
+++ b/security-admin/db/oracle/xa_core_db_oracle.sql
@@ -31,7 +31,6 @@ CREATE SEQUENCE X_PORTAL_USER_ROLE_SEQ START WITH 1 INCREMENT 
BY 1 NOCACHE NOCYC
 CREATE SEQUENCE X_RESOURCE_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 CREATE SEQUENCE X_TRX_LOG_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 CREATE SEQUENCE X_USER_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
-CREATE SEQUENCE X_DB_VERSION_H_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 CREATE SEQUENCE V_TRX_LOG_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
 CREATE SEQUENCE XA_ACCESS_AUDIT_SEQ START WITH 1 INCREMENT BY 1 NOCACHE 
NOCYCLE;
 commit;

Reply via email to