You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by pr...@apache.org on 2018/03/27 06:54:24 UTC
ranger git commit: RANGER-2032: Use consolidated and optimized DB
schema script for fresh install of Ranger
Repository: ranger
Updated Branches:
refs/heads/master ec754db0f -> 59956846b
RANGER-2032: Use consolidated and optimized DB schema script for fresh install of Ranger
Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/59956846
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/59956846
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/59956846
Branch: refs/heads/master
Commit: 59956846bc915a1b051fecc062440af22f6b7d79
Parents: ec754db
Author: pradeep <pr...@apache.org>
Authored: Fri Mar 23 14:01:53 2018 +0530
Committer: pradeep <pr...@apache.org>
Committed: Tue Mar 27 12:24:05 2018 +0530
----------------------------------------------------------------------
.../optimized/current/ranger_core_db_mysql.sql | 8 +++++---
...-to-policy-and-tag-for-time-based-processing.sql | 8 ++++----
.../optimized/current/ranger_core_db_oracle.sql | 6 ++++--
...-to-policy-and-tag-for-time-based-processing.sql | 8 ++++----
.../optimized/current/ranger_core_db_postgres.sql | 16 +++++++++-------
...-to-policy-and-tag-for-time-based-processing.sql | 8 ++++----
.../current/ranger_core_db_sqlanywhere.sql | 8 ++++++--
...-to-policy-and-tag-for-time-based-processing.sql | 8 ++++----
.../optimized/current/ranger_core_db_sqlserver.sql | 6 ++++--
...-to-policy-and-tag-for-time-based-processing.sql | 8 ++++----
security-admin/scripts/install.properties | 13 +++++++------
.../java/org/apache/ranger/entity/XXPolicyBase.java | 2 +-
12 files changed, 56 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
index 7892a6a..65fc51c 100644
--- a/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
+++ b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
@@ -401,7 +401,6 @@ CREATE TABLE `x_resource` (
`policy_name` VARCHAR( 500 ) NULL DEFAULT NULL,
`res_topologies` TEXT NULL DEFAULT NULL,
`res_services` TEXT NULL DEFAULT NULL,
- `ip_address` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `x_resource_UK_policy_name` (`policy_name`),
KEY `x_resource_FK_added_by_id` (`added_by_id`),
@@ -460,6 +459,7 @@ CREATE TABLE `x_perm_map` (
`is_recursive` int(11) NOT NULL DEFAULT '0',
`is_wild_card` tinyint(1) NOT NULL DEFAULT '1',
`grant_revoke` tinyint(1) NOT NULL DEFAULT '1',
+ `ip_address` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `x_perm_map_FK_added_by_id` (`added_by_id`),
KEY `x_perm_map_FK_upd_by_id` (`upd_by_id`),
@@ -570,7 +570,7 @@ CREATE TABLE `x_policy` (
`resource_signature` varchar(128) DEFAULT NULL,
`is_enabled` tinyint(1) NOT NULL DEFAULT '0',
`is_audit_enabled` tinyint(1) NOT NULL DEFAULT '0',
-`options` varchar(4000) NULL DEFAULT NULL,
+`policy_options` varchar(4000) NULL DEFAULT NULL,
`policy_priority` int NOT NULL DEFAULT '0',
primary key (`id`),
KEY `x_policy_added_by_id` (`added_by_id`),
@@ -1004,7 +1004,7 @@ CREATE TABLE IF NOT EXISTS `x_tag` (
`version` BIGINT(20) NULL DEFAULT NULL,
`type` BIGINT(20) NOT NULL,
`owned_by` SMALLINT DEFAULT 0 NOT NULL,
-`options` varchar(4000) NULL DEFAULT NULL,
+`policy_options` varchar(4000) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `x_tag_UK_guid` (`guid`),
KEY `x_tag_IDX_type` (`type`),
@@ -1340,6 +1340,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('029',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('030',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('032',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,UTC_TIMESTAMP(),UTC_TIMESTAMP(),1,1,1);
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,1,UTC_TIMESTAMP(),UTC_TIMESTAMP(),1,1,1);
@@ -1371,4 +1372,5 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10010',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10011',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10012',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10013',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('JAVA_PATCHES',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/mysql/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/mysql/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql b/security-admin/db/mysql/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
index f8bedc4..6ac09cf 100644
--- a/security-admin/db/mysql/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
+++ b/security-admin/db/mysql/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
@@ -17,8 +17,8 @@ drop procedure if exists add_x_policy_columns_for_time_based_classification;
delimiter ;;
create procedure add_x_policy_columns_for_time_based_classification() begin
-if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_policy' and column_name='options') then
- ALTER TABLE x_policy ADD options varchar(4000) NULL DEFAULT NULL;
+if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_policy' and column_name='policy_options') then
+ ALTER TABLE x_policy ADD policy_options varchar(4000) NULL DEFAULT NULL;
end if;
if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_policy' and column_name='policy_priority') then
ALTER TABLE x_policy ADD policy_priority int NOT NULL DEFAULT '0';
@@ -33,8 +33,8 @@ drop procedure if exists add_x_policy_columns_for_time_based_classification;
delimiter ;;
create procedure add_x_tag_columns_for_time_based_classification() begin
-if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_tag' and column_name='options') then
- ALTER TABLE x_tag ADD options varchar(4000) NULL DEFAULT NULL;
+if not exists (select * from information_schema.columns where table_schema=database() and table_name = 'x_tag' and column_name='policy_options') then
+ ALTER TABLE x_tag ADD policy_options varchar(4000) NULL DEFAULT NULL;
end if;
end;;
delimiter ;
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql b/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
index 1f03978..0634776 100644
--- a/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
+++ b/security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql
@@ -456,7 +456,7 @@ description VARCHAR(1024) DEFAULT NULL NULL,
resource_signature VARCHAR(128) DEFAULT NULL NULL,
is_enabled NUMBER(1) DEFAULT '0' NOT NULL,
is_audit_enabled NUMBER(1) DEFAULT '0' NOT NULL,
-options varchar(4000) DEFAULT NULL NULL,
+policy_options varchar(4000) DEFAULT NULL NULL,
policy_priority NUMBER(11) DEFAULT 0 NOT NULL,
primary key (id),
CONSTRAINT x_policy_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
@@ -876,7 +876,7 @@ upd_by_id NUMBER(20) DEFAULT NULL NULL,
version NUMBER(20) DEFAULT NULL NULL,
type NUMBER(20) NOT NULL,
owned_by NUMBER(6) DEFAULT 0 NOT NULL,
-options varchar(4000) DEFAULT NULL NULL,
+policy_options varchar(4000) DEFAULT NULL NULL,
primary key (id),
CONSTRAINT x_tag_UK_guid UNIQUE (guid),
CONSTRAINT x_tag_FK_type FOREIGN KEY (type) REFERENCES x_tag_def (id),
@@ -1316,6 +1316,7 @@ INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,act
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '029',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '030',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '031',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
+INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '032',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, 'DB_PATCHES',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
INSERT INTO x_user_module_perm (id,user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (X_USER_MODULE_PERM_SEQ.nextval,1,3,sys_extract_utc(systimestamp),sys_extract_utc(systimestamp),1,1,1);
INSERT INTO x_user_module_perm (id,user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (X_USER_MODULE_PERM_SEQ.nextval,1,1,sys_extract_utc(systimestamp),sys_extract_utc(systimestamp),1,1,1);
@@ -1347,5 +1348,6 @@ INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,act
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval,'J10010',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval,'J10011',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval,'J10012',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
+INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval,'J10013',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval,'JAVA_PATCHES',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
commit;
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/oracle/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/oracle/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql b/security-admin/db/oracle/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
index 4183572..f0a5e77 100644
--- a/security-admin/db/oracle/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
+++ b/security-admin/db/oracle/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
@@ -16,9 +16,9 @@
DECLARE
v_count number:=0;
BEGIN
- select count(*) into v_count from user_tab_cols where table_name='X_POLICY' and column_name='OPTIONS';
+ select count(*) into v_count from user_tab_cols where table_name='X_POLICY' and column_name='POLICY_OPTIONS';
if (v_count = 0) then
- execute immediate 'ALTER TABLE x_policy ADD options varchar(4000) DEFAULT NULL NULL';
+ execute immediate 'ALTER TABLE x_policy ADD policy_options varchar(4000) DEFAULT NULL NULL';
end if;
select count(*) into v_count from user_tab_cols where table_name='X_POLICY' and column_name='POLICY_PRIORITY';
@@ -26,9 +26,9 @@ BEGIN
execute immediate 'ALTER TABLE x_policy ADD policy_priority NUMBER(11) DEFAULT 0 NOT NULL';
end if;
- select count(*) into v_count from user_tab_cols where table_name='X_TAG' and column_name='OPTIONS';
+ select count(*) into v_count from user_tab_cols where table_name='X_TAG' and column_name='POLICY_OPTIONS';
if (v_count = 0) then
- execute immediate 'ALTER TABLE x_tag ADD options varchar(4000) DEFAULT NULL NULL';
+ execute immediate 'ALTER TABLE x_tag ADD policy_options varchar(4000) DEFAULT NULL NULL';
end if;
commit;
END;/
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
index 5b3f4be..70f4bcc 100644
--- a/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
+++ b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
@@ -463,7 +463,7 @@ description VARCHAR(1024) DEFAULT NULL NULL,
resource_signature VARCHAR(128) DEFAULT NULL NULL,
is_enabled BOOLEAN DEFAULT '0' NOT NULL,
is_audit_enabled BOOLEAN DEFAULT '0' NOT NULL,
-options VARCHAR(4000) DEFAULT NULL NULL,
+policy_options VARCHAR(4000) DEFAULT NULL NULL,
policy_priority INT DEFAULT 0 NOT NULL,
primary key(id),
CONSTRAINT x_policy_FK_added_by_id FOREIGN KEY(added_by_id) REFERENCES x_portal_user(id),
@@ -821,7 +821,7 @@ added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
policy_item_id BIGINT NOT NULL,
user_id BIGINT DEFAULT NULL NULL,
-sort_order INT,
+sort_order SMALLINT DEFAULT '0' NULL,
primary key(id),
CONSTRAINT x_plc_itm_usr_perm_FK_pi_id FOREIGN KEY(policy_item_id) REFERENCES x_policy_item(id),
CONSTRAINT x_plc_itm_usr_perm_FK_user_id FOREIGN KEY(user_id) REFERENCES x_user(id),
@@ -842,7 +842,7 @@ added_by_id BIGINT DEFAULT NULL NULL,
upd_by_id BIGINT DEFAULT NULL NULL,
policy_item_id BIGINT NOT NULL,
group_id BIGINT DEFAULT NULL NULL,
-sort_order INT,
+sort_order SMALLINT DEFAULT '0' NULL,
primary key(id),
CONSTRAINT x_plc_itm_grp_perm_FK_pi_id FOREIGN KEY(policy_item_id) REFERENCES x_policy_item(id),
CONSTRAINT x_plc_itm_grp_perm_FK_group_id FOREIGN KEY(group_id) REFERENCES x_group(id),
@@ -953,7 +953,7 @@ upd_by_id BIGINT DEFAULT NULL NULL,
version BIGINT DEFAULT NULL NULL,
type BIGINT NOT NULL,
owned_by SMALLINT DEFAULT 0 NOT NULL,
-options VARCHAR(4000) DEFAULT NULL NULL,
+policy_options VARCHAR(4000) DEFAULT NULL NULL,
primary key (id),
CONSTRAINT x_tag_UK_guid UNIQUE (guid),
CONSTRAINT x_tag_FK_type FOREIGN KEY (type) REFERENCES x_tag_def (id),
@@ -1221,11 +1221,11 @@ upd_by_id BIGINT DEFAULT NULL NULL,
event_time TIMESTAMP DEFAULT NULL NULL,
user_name varchar(255) NOT NULL,
sync_source varchar(128) NOT NULL,
-no_of_users bigint(20) NOT NULL,
-no_of_groups bigint(20) NOT NULL,
+no_of_users BIGINT NOT NULL,
+no_of_groups BIGINT NOT NULL,
sync_source_info varchar(4000) NOT NULL,
session_id varchar(255) DEFAULT NULL,
-primary key (id),
+primary key (id)
);
CREATE INDEX xa_access_audit_added_by_id ON xa_access_audit(added_by_id);
@@ -1429,6 +1429,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('029',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('030',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('032',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,current_timestamp,current_timestamp,1,1,1);
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,1,current_timestamp,current_timestamp,1,1,1);
@@ -1460,6 +1461,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10010',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10011',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10012',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10013',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('JAVA_PATCHES',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
DROP VIEW IF EXISTS vx_trx_log;
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/postgres/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/postgres/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql b/security-admin/db/postgres/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
index 53ddacc..8b605f4 100644
--- a/security-admin/db/postgres/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
+++ b/security-admin/db/postgres/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
@@ -20,9 +20,9 @@ RETURNS void AS $$
DECLARE
v_column_exists integer := 0;
BEGIN
- select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_policy') and attname='options';
+ select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_policy') and attname='policy_options';
IF v_column_exists = 0 THEN
- ALTER TABLE x_policy ADD COLUMN options VARCHAR(4000) DEFAULT NULL NULL;
+ ALTER TABLE x_policy ADD COLUMN policy_options VARCHAR(4000) DEFAULT NULL NULL;
END IF;
select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_policy') and attname='policy_priority';
IF v_column_exists = 0 THEN
@@ -41,9 +41,9 @@ RETURNS void AS $$
DECLARE
v_column_exists integer := 0;
BEGIN
- select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_tag') and attname='options';
+ select count(*) into v_column_exists from pg_attribute where attrelid in(select oid from pg_class where relname='x_tag') and attname='policy_options';
IF v_column_exists = 0 THEN
- ALTER TABLE x_tag ADD COLUMN options VARCHAR(4000) DEFAULT NULL NULL;
+ ALTER TABLE x_tag ADD COLUMN policy_options VARCHAR(4000) DEFAULT NULL NULL;
END IF;
END;
$$ LANGUAGE plpgsql;
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql b/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
index 42a8704..d59788c 100644
--- a/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
+++ b/security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
@@ -341,7 +341,7 @@ create table dbo.x_policy (
resource_signature varchar(128) DEFAULT NULL NULL,
is_enabled tinyint DEFAULT 0 NOT NULL,
is_audit_enabled tinyint DEFAULT 0 NOT NULL,
- options varchar(4000) DEFAULT NULL NULL,
+ policy_options varchar(4000) DEFAULT NULL NULL,
policy_priority int DEFAULT 0 NOT NULL,
CONSTRAINT x_policy_PK_id PRIMARY KEY CLUSTERED(id)
)
@@ -692,7 +692,7 @@ CREATE TABLE dbo.x_tag(
version bigint DEFAULT NULL NULL,
type bigint NOT NULL,
owned_by smallint DEFAULT 0 NOT NULL,
- options varchar(4000) DEFAULT NULL NULL,
+ policy_options varchar(4000) DEFAULT NULL NULL,
CONSTRAINT x_tag_PK_id PRIMARY KEY CLUSTERED(id),
CONSTRAINT x_tag_UK_guid UNIQUE NONCLUSTERED (guid)
)
@@ -1582,6 +1582,8 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
GO
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
GO
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('032',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
+GO
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
GO
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);
@@ -1644,6 +1646,8 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
GO
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10012',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
GO
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10013',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
+GO
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('JAVA_PATCHES',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
GO
exit
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/sqlanywhere/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlanywhere/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql b/security-admin/db/sqlanywhere/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
index 1314ecb..373a6fb 100644
--- a/security-admin/db/sqlanywhere/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
+++ b/security-admin/db/sqlanywhere/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
@@ -13,16 +13,16 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
-IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_policy' and cname = 'options') THEN
- ALTER TABLE dbo.x_policy ADD options varchar(4000) DEFAULT NULL NULL;
+IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_policy' and cname = 'policy_options') THEN
+ ALTER TABLE dbo.x_policy ADD policy_options varchar(4000) DEFAULT NULL NULL;
END IF;
GO
IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_policy' and cname = 'policy_priority') THEN
ALTER TABLE dbo.x_policy ADD policy_priority int DEFAULT 0 NOT NULL;
END IF;
GO
-IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_tag' and cname = 'options') THEN
- ALTER TABLE dbo.x_tag ADD options varchar(4000) DEFAULT NULL NULL;
+IF NOT EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_tag' and cname = 'policy_options') THEN
+ ALTER TABLE dbo.x_tag ADD policy_options varchar(4000) DEFAULT NULL NULL;
END IF;
GO
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql b/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
index 7421d4d..f67f109 100644
--- a/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
+++ b/security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
@@ -1155,7 +1155,7 @@ CREATE TABLE [dbo].[x_policy] (
[resource_signature] [varchar](128) DEFAULT NULL NULL,
[is_enabled] [tinyint] DEFAULT 0 NOT NULL,
[is_audit_enabled] [tinyint] DEFAULT 0 NOT NULL,
- [options] [varchar](4000) DEFAULT NULL NULL,
+ [policy_options] [varchar](4000) DEFAULT NULL NULL,
[policy_priority] [int] DEFAULT 0 NOT NULL,
PRIMARY KEY CLUSTERED
(
@@ -1619,7 +1619,7 @@ CREATE TABLE [dbo].[x_tag](
[version] [bigint] DEFAULT NULL NULL,
[type] [bigint] NOT NULL,
[owned_by] [smallint] DEFAULT 0 NOT NULL,
- [options] [varchar](4000) DEFAULT NULL NULL,
+ [policy_options] [varchar](4000) DEFAULT NULL NULL,
PRIMARY KEY CLUSTERED
(
[id] ASC
@@ -3096,6 +3096,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('029',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('030',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('031',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('032',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,3,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (1,1,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,1,1,1);
@@ -3127,6 +3128,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10010',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10011',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10012',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
+INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10013',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('JAVA_PATCHES',CURRENT_TIMESTAMP,'Ranger 1.0.0',CURRENT_TIMESTAMP,'localhost','Y');
GO
CREATE VIEW [dbo].[vx_trx_log] AS
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/db/sqlserver/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlserver/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql b/security-admin/db/sqlserver/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
index 932861c..74482cb 100644
--- a/security-admin/db/sqlserver/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
+++ b/security-admin/db/sqlserver/patches/032-add-options-to-policy-and-tag-for-time-based-processing.sql
@@ -14,9 +14,9 @@
-- limitations under the License.
GO
-IF NOT EXISTS(select * from INFORMATION_SCHEMA.columns where table_name = 'x_policy' and column_name = 'options')
+IF NOT EXISTS(select * from INFORMATION_SCHEMA.columns where table_name = 'x_policy' and column_name = 'policy_options')
BEGIN
- ALTER TABLE [dbo].[x_policy] ADD [options] [varchar](4000) DEFAULT NULL NULL;
+ ALTER TABLE [dbo].[x_policy] ADD [policy_options] [varchar](4000) DEFAULT NULL NULL;
END
GO
GO
@@ -26,9 +26,9 @@ BEGIN
END
GO
GO
-IF NOT EXISTS(select * from INFORMATION_SCHEMA.columns where table_name = 'x_tag' and column_name = 'options')
+IF NOT EXISTS(select * from INFORMATION_SCHEMA.columns where table_name = 'x_tag' and column_name = 'policy_options')
BEGIN
- ALTER TABLE [dbo].[x_tag] ADD [options] [varchar](4000) DEFAULT NULL NULL;
+ ALTER TABLE [dbo].[x_tag] ADD [policy_options] [varchar](4000) DEFAULT NULL NULL;
END
GO
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/scripts/install.properties
----------------------------------------------------------------------
diff --git a/security-admin/scripts/install.properties b/security-admin/scripts/install.properties
index 9941733..8128678 100644
--- a/security-admin/scripts/install.properties
+++ b/security-admin/scripts/install.properties
@@ -226,20 +226,21 @@ JAVA_VERSION_REQUIRED='1.7'
JAVA_ORACLE='Java(TM) SE Runtime Environment'
#mysql_create_user_file=${PWD}/db/mysql/create_dev_user.sql
-mysql_core_file=db/mysql/xa_core_db.sql
+mysql_core_file=db/mysql/optimized/current/ranger_core_db_mysql.sql
mysql_audit_file=db/mysql/xa_audit_db.sql
#mysql_asset_file=${PWD}/db/mysql/reset_asset.sql
#oracle_create_user_file=${PWD}/db/oracle/create_dev_user_oracle.sql
-oracle_core_file=db/oracle/xa_core_db_oracle.sql
+oracle_core_file=db/oracle/optimized/current/ranger_core_db_oracle.sql
oracle_audit_file=db/oracle/xa_audit_db_oracle.sql
#oracle_asset_file=${PWD}/db/oracle/reset_asset_oracle.sql
#
-postgres_core_file=db/postgres/xa_core_db_postgres.sql
+postgres_core_file=db/postgres/optimized/current/ranger_core_db_postgres.sql
postgres_audit_file=db/postgres/xa_audit_db_postgres.sql
-sqlserver_core_file=db/sqlserver/xa_core_db_sqlserver.sql
+#
+sqlserver_core_file=db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql
sqlserver_audit_file=db/sqlserver/xa_audit_db_sqlserver.sql
#
-sqlanywhere_core_file=db/sqlanywhere/xa_core_db_sqlanywhere.sql
+sqlanywhere_core_file=db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql
sqlanywhere_audit_file=db/sqlanywhere/xa_audit_db_sqlanywhere.sql
-cred_keystore_filename=$app_home/WEB-INF/classes/conf/.jceks/rangeradmin.jceks
+cred_keystore_filename=$app_home/WEB-INF/classes/conf/.jceks/rangeradmin.jceks
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ranger/blob/59956846/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java
index 2616594..584a103 100644
--- a/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java
+++ b/security-admin/src/main/java/org/apache/ranger/entity/XXPolicyBase.java
@@ -124,7 +124,7 @@ public abstract class XXPolicyBase extends XXDBBase {
* </ul>
*
*/
- @Column(name = "options")
+ @Column(name = "policy_options")
protected String options;
/**
* @return the gUID