-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alejandro Sanchez <[email protected]>
- Loading branch information
1 parent
b6de9cc
commit f280519
Showing
19 changed files
with
807 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ce/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/76_DML_PIMS_ROLE_CLAIM.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
DECLARE @managementView BIGINT; | ||
DECLARE @managementAdd BIGINT; | ||
DECLARE @managementEdit BIGINT; | ||
DECLARE @managementDelete BIGINT; | ||
SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; | ||
SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; | ||
SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; | ||
SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; | ||
|
||
DECLARE @managementFunctional BIGINT; | ||
DECLARE @managementReadOnly BIGINT; | ||
SELECT @managementFunctional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; | ||
SELECT @managementReadOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; | ||
|
||
DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementView; | ||
DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementEdit; | ||
DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementAdd; | ||
DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE CLAIM_ID = @managementDelete; | ||
|
||
DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE ROLE_ID = @managementFunctional; | ||
DELETE FROM [dbo].[PIMS_ROLE_CLAIM] WHERE ROLE_ID = @managementReadOnly; | ||
|
||
GO |
16 changes: 16 additions & 0 deletions
16
source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/77_DML_PIMS_CLAIM.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
DECLARE @managementView BIGINT; | ||
DECLARE @managementAdd BIGINT; | ||
DECLARE @managementEdit BIGINT; | ||
DECLARE @managementDelete BIGINT; | ||
SELECT @managementView = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-view'; | ||
SELECT @managementAdd = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-add'; | ||
SELECT @managementEdit = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-edit'; | ||
SELECT @managementDelete = CLAIM_ID FROM PIMS_CLAIM WHERE NAME = 'management-delete'; | ||
|
||
|
||
DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementView; | ||
DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementEdit; | ||
DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementAdd; | ||
DELETE FROM [dbo].[PIMS_CLAIM] WHERE CLAIM_ID = @managementDelete; | ||
|
||
GO |
10 changes: 10 additions & 0 deletions
10
source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/78_DML_PIMS_ROLE.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DECLARE @managementFunctional BIGINT; | ||
DECLARE @managementReadOnly BIGINT; | ||
SELECT @managementFunctional = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management functional'; | ||
SELECT @managementReadOnly = ROLE_ID FROM PIMS_ROLE WHERE NAME = 'Management read-only'; | ||
|
||
|
||
DELETE FROM [dbo].[PIMS_ROLE] WHERE ROLE_ID = @managementFunctional; | ||
DELETE FROM [dbo].[PIMS_ROLE] WHERE ROLE_ID = @managementReadOnly; | ||
|
||
GO |
4 changes: 4 additions & 0 deletions
4
source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/075_DML_PIMS_ROLE.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
INSERT INTO PIMS_ROLE (ROLE_UID, NAME, DESCRIPTION, IS_PUBLIC, IS_DISABLED, SORT_ORDER, APP_CREATE_TIMESTAMP, APP_CREATE_USERID, APP_CREATE_USER_DIRECTORY, APP_LAST_UPDATE_TIMESTAMP, APP_LAST_UPDATE_USERID, APP_LAST_UPDATE_USER_DIRECTORY) | ||
VALUES | ||
(NEWID(), N'Management functional', N'Access to create, read, update Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'), | ||
(NEWID(), N'Management read-only', N'Access to read Management information.', CONVERT([bit],(1)), CONVERT([bit],(0)), 0, CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data', CURRENT_TIMESTAMP, N'Seed Data', N'Seed Data'); |
30 changes: 30 additions & 0 deletions
30
source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/76_DML_PIMS_CLAIM.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
BEGIN TRANSACTION; | ||
|
||
DECLARE @dbUserId nvarchar(30) = 'system'; | ||
DECLARE @dbUserGuid uniqueidentifier = null; | ||
DECLARE @appUserId nvarchar(30) = N'SEED'; | ||
DECLARE @appUserGuid uniqueidentifier = '1b93f614-91da-4b32-b36e-bd2c6ebd12e2'; | ||
DECLARE @appUserDirectory nvarchar(30) = N''; | ||
DECLARE @seedTime DateTime = GETDATE(); | ||
|
||
INSERT [dbo].[PIMS_CLAIM] | ||
([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) | ||
VALUES | ||
(57, N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'management-view', N'bd03cd23-00c0-4ba0-88af-9f75c788d132', N'Ability to view Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); | ||
|
||
INSERT [dbo].[PIMS_CLAIM] | ||
([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) | ||
VALUES | ||
(58, N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'management-add', N'b52f72ee-f67c-46e4-8977-d835876bd99e', N'Ability to add new Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); | ||
|
||
INSERT [dbo].[PIMS_CLAIM] | ||
([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) | ||
VALUES | ||
(59, N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'management-edit', N'f2245e95-6972-4cdb-9893-ae9e14442d2c', N'Ability to edit existing Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); | ||
|
||
INSERT [dbo].[PIMS_CLAIM] | ||
([CLAIM_ID], [CLAIM_UID], [NAME], [KEYCLOAK_ROLE_ID], [DESCRIPTION], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID]) | ||
VALUES | ||
(60, N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'management-delete', N'3b4c435c-e74f-47e4-a229-74e89f7efaec', N'Ability to delete Property Management information.', 0, 1, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId, @seedTime, @appUserId, @appUserGuid, @appUserDirectory, @seedTime, @dbUserId); | ||
|
||
COMMIT TRANSACTION; |
Oops, something went wrong.