This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch ranger-2.5
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/ranger-2.5 by this push:
     new f825d5aff RANGER-4812: Database schema patch to create x_trx_log_v2 
table
f825d5aff is described below

commit f825d5aff148b3f84f81b90d21d7d47328eeff35
Author: princeap173 <[email protected]>
AuthorDate: Thu Jun 20 00:42:55 2024 +0530

    RANGER-4812: Database schema patch to create x_trx_log_v2 table
    
    Signed-off-by: Madhan Neethiraj <[email protected]>
    (cherry picked from commit 058388faf5360e61fb2602ade5797c1b21fbe5b7)
---
 .../db/mysql/patches/073-create-x_trx_log_v2.sql   | 38 ++++++++++++
 .../db/oracle/patches/077-create-x_trx_log_v2.sql  | 43 +++++++++++++
 .../postgres/patches/073-create-x_trx_log_v2.sql   | 42 +++++++++++++
 .../patches/067-create-x_trx_log_v2.sql            | 47 +++++++++++++++
 .../sqlserver/patches/067-create-x_trx_log_v2.sql  | 70 ++++++++++++++++++++++
 5 files changed, 240 insertions(+)

diff --git a/security-admin/db/mysql/patches/073-create-x_trx_log_v2.sql 
b/security-admin/db/mysql/patches/073-create-x_trx_log_v2.sql
new file mode 100644
index 000000000..965779cdd
--- /dev/null
+++ b/security-admin/db/mysql/patches/073-create-x_trx_log_v2.sql
@@ -0,0 +1,38 @@
+-- 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.
+
+DROP TABLE IF EXISTS `x_trx_log_v2`;
+
+CREATE TABLE `x_trx_log_v2` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `create_time` datetime DEFAULT NULL,
+  `added_by_id` bigint(20) DEFAULT NULL,
+  `class_type` int(11) NOT NULL DEFAULT '0',
+  `object_id` bigint(20) DEFAULT NULL,
+  `parent_object_id` bigint(20) DEFAULT NULL,
+  `parent_object_class_type` int(11) NOT NULL DEFAULT '0',
+  `parent_object_name` varchar(1024) DEFAULT NULL,
+  `object_name` varchar(1024) DEFAULT NULL,
+  `change_info` MEDIUMTEXT NULL DEFAULT NULL,
+  `trx_id` varchar(1024) DEFAULT NULL,
+  `action` varchar(255) DEFAULT NULL,
+  `sess_id` varchar(512) DEFAULT NULL,
+  `req_id` varchar(30) DEFAULT NULL,
+  `sess_type` varchar(30) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `x_trx_log_v2_FK_added_by_id` (`added_by_id`),
+  KEY `x_trx_log_v2_cr_time` (`create_time`),
+  KEY `x_trx_log_v2_trx_id` (`trx_id`)
+)ROW_FORMAT=DYNAMIC;
\ No newline at end of file
diff --git a/security-admin/db/oracle/patches/077-create-x_trx_log_v2.sql 
b/security-admin/db/oracle/patches/077-create-x_trx_log_v2.sql
new file mode 100644
index 000000000..46c9489e1
--- /dev/null
+++ b/security-admin/db/oracle/patches/077-create-x_trx_log_v2.sql
@@ -0,0 +1,43 @@
+-- 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.
+
+call spdropsequence('X_TRX_LOG_V2_SEQ');
+
+CREATE SEQUENCE X_TRX_LOG_V2_SEQ START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+call spdroptable('x_trx_log_v2');
+
+CREATE TABLE x_trx_log_v2 (
+        id NUMBER(20) NOT NULL,
+        create_time DATE DEFAULT NULL NULL ,
+        added_by_id NUMBER(20) DEFAULT NULL NULL ,
+        class_type NUMBER(11) DEFAULT '0' NOT NULL ,
+        object_id NUMBER(20) DEFAULT NULL NULL ,
+        parent_object_id NUMBER(20) DEFAULT NULL NULL ,
+        parent_object_class_type NUMBER(11) DEFAULT '0' NOT NULL ,
+        parent_object_name VARCHAR(1024) DEFAULT NULL NULL ,
+        change_info CLOB DEFAULT NULL NULL ,
+        trx_id VARCHAR(1024) DEFAULT NULL NULL ,
+        action VARCHAR(255) DEFAULT NULL NULL ,
+        sess_id VARCHAR(512) DEFAULT NULL NULL ,
+        req_id VARCHAR(30) DEFAULT NULL NULL ,
+        sess_type VARCHAR(30) DEFAULT NULL NULL ,
+        PRIMARY KEY (id)
+);
+
+CREATE INDEX x_trx_log_v2_FK_added_by_id ON x_trx_log_v2 (added_by_id);
+CREATE INDEX x_trx_log_v2_cr_time ON x_trx_log_v2 (create_time);
+CREATE INDEX x_trx_log_v2_trx_id ON x_trx_log_v2 (trx_id);
+commit;
\ No newline at end of file
diff --git a/security-admin/db/postgres/patches/073-create-x_trx_log_v2.sql 
b/security-admin/db/postgres/patches/073-create-x_trx_log_v2.sql
new file mode 100644
index 000000000..d69358313
--- /dev/null
+++ b/security-admin/db/postgres/patches/073-create-x_trx_log_v2.sql
@@ -0,0 +1,42 @@
+-- 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.
+
+DROP TABLE IF EXISTS x_trx_log_v2 CASCADE;
+
+DROP SEQUENCE IF EXISTS x_trx_log_v2_seq;
+
+CREATE SEQUENCE x_trx_log_v2_seq;
+CREATE TABLE x_trx_log_v2(
+id BIGINT DEFAULT nextval('x_trx_log_v2_seq'::regclass),
+create_time TIMESTAMP DEFAULT NULL NULL,
+added_by_id BIGINT DEFAULT NULL NULL,
+class_type INT DEFAULT '0' NOT NULL,
+object_id BIGINT DEFAULT NULL NULL,
+parent_object_id BIGINT DEFAULT NULL NULL,
+parent_object_class_type INT DEFAULT '0' NOT NULL,
+parent_object_name VARCHAR(1024) DEFAULT NULL NULL,
+object_name VARCHAR(1024) DEFAULT NULL NULL,
+change_info TEXT NULL DEFAULT NULL,
+trx_id VARCHAR(1024) DEFAULT NULL NULL,
+action VARCHAR(255) DEFAULT NULL NULL,
+sess_id VARCHAR(512) DEFAULT NULL NULL,
+req_id VARCHAR(30) DEFAULT NULL NULL,
+sess_type VARCHAR(30) DEFAULT NULL NULL,
+PRIMARY KEY(id)
+);
+
+CREATE INDEX x_trx_log_v2_FK_added_by_id ON x_trx_log_v2(added_by_id);
+CREATE INDEX x_trx_log_v2_cr_time ON x_trx_log_v2(create_time);
+CREATE INDEX x_trx_log_v2_trx_id ON x_trx_log_v2(trx_id);
\ No newline at end of file
diff --git a/security-admin/db/sqlanywhere/patches/067-create-x_trx_log_v2.sql 
b/security-admin/db/sqlanywhere/patches/067-create-x_trx_log_v2.sql
new file mode 100644
index 000000000..0036e90fa
--- /dev/null
+++ b/security-admin/db/sqlanywhere/patches/067-create-x_trx_log_v2.sql
@@ -0,0 +1,47 @@
+-- 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.
+
+call dbo.removeForeignKeysAndTable('x_trx_log_v2')
+GO
+
+create table dbo.x_trx_log_v2(
+       id bigint IDENTITY NOT NULL,
+       create_time datetime DEFAULT NULL NULL,
+       added_by_id bigint DEFAULT NULL NULL,
+       class_type int DEFAULT 0 NOT NULL,
+       object_id bigint DEFAULT NULL NULL,
+       parent_object_id bigint DEFAULT NULL NULL,
+       parent_object_class_type int DEFAULT 0 NOT NULL,
+       parent_object_name varchar(1024) DEFAULT NULL NULL,
+       object_name varchar(1024) DEFAULT NULL NULL,
+       change_info text DEFAULT NULL NULL,
+       trx_id varchar(1024)DEFAULT NULL NULL,
+       action varchar(255) DEFAULT NULL NULL,
+       sess_id varchar(512) DEFAULT NULL NULL,
+       req_id varchar(30) DEFAULT NULL NULL,
+       sess_type varchar(30) DEFAULT NULL NULL,
+       CONSTRAINT x_trx_log_v2_PK_id PRIMARY KEY CLUSTERED(id)
+)
+GO
+
+CREATE NONCLUSTERED INDEX x_trx_log_v2_FK_cr_time ON 
dbo.x_trx_log_v2(create_time ASC)
+GO
+
+CREATE NONCLUSTERED INDEX x_trx_log_v2_FK_added_by_id ON 
dbo.x_trx_log_v2(added_by_id ASC)
+GO
+
+CREATE NONCLUSTERED INDEX x_trx_log_v2_FK_trx_id ON dbo.x_trx_log_v2(trx_id 
ASC)
+GO
+EXIT
\ No newline at end of file
diff --git a/security-admin/db/sqlserver/patches/067-create-x_trx_log_v2.sql 
b/security-admin/db/sqlserver/patches/067-create-x_trx_log_v2.sql
new file mode 100644
index 000000000..ab49b5bf4
--- /dev/null
+++ b/security-admin/db/sqlserver/patches/067-create-x_trx_log_v2.sql
@@ -0,0 +1,70 @@
+-- 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.
+
+IF (OBJECT_ID('x_trx_log_v2') IS NOT NULL)
+BEGIN
+    DROP TABLE [dbo].[x_trx_log_v2]
+END
+GO
+
+SET ANSI_NULLS ON
+SET QUOTED_IDENTIFIER ON
+SET ANSI_PADDING ON
+GO
+
+CREATE TABLE [dbo].[x_trx_log_v2](
+        [id] [bigint] IDENTITY(1,1) NOT NULL,
+        [create_time] [datetime2] DEFAULT NULL NULL,
+        [added_by_id] [bigint] DEFAULT NULL NULL,
+        [class_type] [int] DEFAULT 0 NOT NULL,
+        [object_id] [bigint] DEFAULT NULL NULL,
+        [parent_object_id] [bigint] DEFAULT NULL NULL,
+        [parent_object_class_type] [int] DEFAULT 0 NOT NULL,
+        [parent_object_name] [varchar](1024)DEFAULT NULL  NULL,
+        [object_name] [varchar](1024) DEFAULT NULL NULL,
+        [change_info] [nvarchar](max)DEFAULT NULL  NULL,
+        [trx_id] [varchar](1024)DEFAULT NULL  NULL,
+        [action] [varchar](255) DEFAULT NULL NULL,
+        [sess_id] [varchar](512) DEFAULT NULL NULL,
+        [req_id] [varchar](30) DEFAULT NULL NULL,
+        [sess_type] [varchar](30) DEFAULT NULL NULL,
+PRIMARY KEY CLUSTERED
+(
+        [id] ASC
+)WITH (PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF,IGNORE_DUP_KEY = 
OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+GO
+
+CREATE NONCLUSTERED INDEX [x_trx_log_v2_cr_time] ON [x_trx_log_v2]
+(
+   [create_time] ASC
+)
+WITH (SORT_IN_TEMPDB = OFF,DROP_EXISTING = OFF,IGNORE_DUP_KEY = OFF,ONLINE = 
OFF) ON [PRIMARY]
+GO
+
+CREATE NONCLUSTERED INDEX [x_trx_log_v2_FK_added_by_id] ON [x_trx_log_v2]
+(
+   [added_by_id] ASC
+)
+WITH (SORT_IN_TEMPDB = OFF,DROP_EXISTING = OFF,IGNORE_DUP_KEY = OFF,ONLINE = 
OFF) ON [PRIMARY]
+GO
+
+CREATE NONCLUSTERED INDEX [x_trx_log_v2_FK_trx_id] ON [x_trx_log_v2]
+(
+   [trx_id] ASC
+)
+WITH (SORT_IN_TEMPDB = OFF,DROP_EXISTING = OFF,IGNORE_DUP_KEY = OFF,ONLINE = 
OFF) ON [PRIMARY]
+GO
+exit
\ No newline at end of file

Reply via email to