rameeshm commented on code in PR #1138:
URL: https://github.com/apache/ranger/pull/1138#discussion_r3954781594
##########
security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql:
##########
@@ -1997,6 +2011,10 @@ INSERT INTO
x_portal_user(CREATE_TIME,UPDATE_TIME,FIRST_NAME,LAST_NAME,PUB_SCR_N
INSERT INTO
x_portal_user_role(CREATE_TIME,UPDATE_TIME,USER_ID,USER_ROLE,STATUS)VALUES(current_timestamp,current_timestamp,getXportalUIdByLoginId('rangertagsync'),'ROLE_SYS_ADMIN',1);
INSERT INTO
x_user(CREATE_TIME,UPDATE_TIME,user_name,status,descr)VALUES(current_timestamp,current_timestamp,'rangertagsync',0,'rangertagsync');
+INSERT INTO
x_portal_user(CREATE_TIME,UPDATE_TIME,FIRST_NAME,LAST_NAME,PUB_SCR_NAME,LOGIN_ID,PASSWORD,EMAIL,STATUS)VALUES(current_timestamp,current_timestamp,'rangerauditserver','','rangerauditserver','rangerauditserver','','rangerauditserver',0);
Review Comment:
All the columns in x_portal_user are not mentioned. Is that ok?
##########
security-admin/db/sqlserver/patches/078-audit-partition-plan-global-state.sql:
##########
@@ -0,0 +1,98 @@
+-- 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.
+SET ANSI_NULLS ON
+GO
+SET QUOTED_IDENTIFIER ON
+GO
+IF EXISTS (SELECT *
+ FROM sys.objects
+ WHERE object_id = OBJECT_ID(N'dbo.getXportalUIdByLoginId')
+ AND type IN ( N'FN', N'IF', N'TF', N'FS', N'FT' ))
+ DROP FUNCTION dbo.getXportalUIdByLoginId
+GO
+CREATE FUNCTION dbo.getXportalUIdByLoginId(@inputValue varchar(200))
+RETURNS int
+AS
+BEGIN
+ DECLARE @myid int;
+ SELECT @myid = id FROM x_portal_user WHERE x_portal_user.login_id =
@inputValue;
+ RETURN @myid;
+END
+GO
+
+IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME =
'x_audit_config')
+BEGIN
+ CREATE TABLE [dbo].[x_audit_config](
+ [id] [bigint] IDENTITY(1,1) NOT NULL,
+ [create_time] [datetime2] DEFAULT NULL NULL,
+ [update_time] [datetime2] DEFAULT NULL NULL,
+ [cfg_name] [varchar](255) NOT NULL,
+ [cfg_value] NVARCHAR(MAX) DEFAULT NULL NULL,
+ [version] [bigint] DEFAULT NULL NULL,
+ PRIMARY KEY CLUSTERED ([id] ASC),
+ CONSTRAINT [x_audit_config_UK_cfg_name] UNIQUE NONCLUSTERED
([cfg_name] ASC)
Review Comment:
should we have it as CONSTRAINT [x_audit_config$x_audit_config_UK_cfg_name]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]