This is an automated email from the ASF dual-hosted git repository.
madhan pushed a commit to branch RANGER-3923
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/RANGER-3923 by this push:
new 0371f6663 RANGER-4395: avoid duplicate resource entries in a datashare
0371f6663 is described below
commit 0371f66639d804fb7c15a0816c37a8aaf0cce0c8
Author: Prashant Satam <[email protected]>
AuthorDate: Wed Sep 13 13:01:33 2023 +0530
RANGER-4395: avoid duplicate resource entries in a datashare
Signed-off-by: Madhan Neethiraj <[email protected]>
---
security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql | 1 +
security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql | 1 +
2 files changed, 2 insertions(+)
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
old mode 100644
new mode 100755
index 4e0a9a746..424f38d9e
--- a/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
+++ b/security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
@@ -1803,6 +1803,7 @@ CREATE TABLE `x_gds_shared_resource`(
, `additional_info` TEXT NULL DEFAULT NULL
, PRIMARY KEY(`id`)
, UNIQUE KEY `x_gds_shared_resource_UK_name`(`data_share_id`, `name`)
+ , UNIQUE KEY `x_gds_shared_resource_UK_resource_signature`(`data_share_id`,
`resource_signature`)
, CONSTRAINT `x_gds_shared_resource_FK_added_by_id` FOREIGN
KEY(`added_by_id`) REFERENCES `x_portal_user`(`id`)
, CONSTRAINT `x_gds_shared_resource_FK_upd_by_id` FOREIGN
KEY(`upd_by_id`) REFERENCES `x_portal_user`(`id`)
, CONSTRAINT `x_gds_shared_resource_FK_data_share_id` FOREIGN
KEY(`data_share_id`) REFERENCES `x_gds_data_share`(`id`)
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
old mode 100644
new mode 100755
index 13fd3724b..5ffa23f33
--- a/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
+++ b/security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql
@@ -1795,6 +1795,7 @@ CREATE TABLE x_gds_shared_resource(
, additional_info TEXT NULL DEFAULT NULL
, PRIMARY KEY(id)
, CONSTRAINT x_gds_shared_resource_UK_name UNIQUE(data_share_id, name)
+ , CONSTRAINT x_gds_shared_resource_UK_resource_signature
UNIQUE(data_share_id, resource_signature)
, CONSTRAINT x_gds_shared_resource_FK_added_by_id FOREIGN KEY(added_by_id)
REFERENCES x_portal_user(id)
, CONSTRAINT x_gds_shared_resource_FK_upd_by_id FOREIGN KEY(upd_by_id)
REFERENCES x_portal_user(id)
, CONSTRAINT x_gds_shared_resource_FK_data_share_id FOREIGN
KEY(data_share_id) REFERENCES x_gds_data_share(id)