-
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.
* IS-72.00 Database Schema PSP_PIMS S72.00 Sprint 72 2024-Jan-16 - Altered tables: - PIMS_PROPERTY - PIMS_PROPERTY_HIST - Altered build scripts: - 002_PSP_PIMS_Build.sql - 020_DML_PIMS_STATIC_VARIABLE.sql - 148_DML_PIMS_DSP_CHKLST_ITEM_TYPE.sql - Added test scripts: - 071_PIMS_PROPERTY_CONTACT.sql - Altered test scripts: - 005_DML_LEASE_PROPERTY.sql - Requires additional metadata to meet standards * fixed build not matching alter up result * aligned latest folder --------- Co-authored-by: Manuel Rodriguez <marobej@gmail.com>
- Loading branch information
1 parent
1337b7a
commit 03a7a3f
Showing
202 changed files
with
78,352 additions
and
15,383 deletions.
There are no files selected for viewing
2,630 changes: 550 additions & 2,080 deletions
2,630
...e/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/002_PSP_PIMS_Alter_Down.sql
Large diffs are not rendered by default.
Oops, something went wrong.
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
48 changes: 48 additions & 0 deletions
48
...pts/dbscripts/PSP_PIMS_LATEST/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.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,48 @@ | ||
/* ----------------------------------------------------------------------------- | ||
Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table. | ||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
Author Date Comment | ||
------------ ----------- ----------------------------------------------------- | ||
Doug Filteau 2024-Jan-10 Initial version | ||
----------------------------------------------------------------------------- */ | ||
|
||
SET XACT_ABORT ON | ||
GO | ||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE | ||
GO | ||
BEGIN TRANSACTION | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
-- Insert the "SGNDXFRPPH" type | ||
DECLARE @CurrCd NVARCHAR(20) | ||
SET @CurrCd = N'SGNDXFRPPH' | ||
|
||
SELECT DSP_CHKLST_ITEM_TYPE_CODE | ||
FROM PIMS_DSP_CHKLST_ITEM_TYPE | ||
WHERE DSP_CHKLST_ITEM_TYPE_CODE = @CurrCd; | ||
|
||
IF @@ROWCOUNT = 1 | ||
BEGIN | ||
DELETE | ||
FROM PIMS_DSP_CHKLST_ITEM_TYPE | ||
WHERE DSP_CHKLST_ITEM_TYPE_CODE = @CurrCd; | ||
END | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
COMMIT TRANSACTION | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
DECLARE @Success AS BIT | ||
SET @Success = 1 | ||
SET NOEXEC OFF | ||
IF (@Success = 1) PRINT 'The database update succeeded' | ||
ELSE BEGIN | ||
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION | ||
PRINT 'The database update failed' | ||
END | ||
GO |
55 changes: 55 additions & 0 deletions
55
...sql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/999_PIMS_PROPERTY_CONTACT_Alter Down.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,55 @@ | ||
-- ---------------------------------------------------------------------------------- | ||
-- Migrate the contact data from the PIMS_PROPERTY_CONTACT table to the PIMS_PROPERTY | ||
-- table. | ||
-- ---------------------------------------------------------------------------------- | ||
|
||
SET XACT_ABORT ON | ||
GO | ||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE | ||
GO | ||
BEGIN TRANSACTION | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
-- Migrate the PROPERTY_MANAGER_ID data | ||
PRINT N'Migrate the PROPERTY_MANAGER_ID data' | ||
GO | ||
UPDATE prop | ||
SET prop.PROPERTY_MANAGER_ID = cnct.PERSON_ID | ||
, prop.CONCURRENCY_CONTROL_NUMBER = prop.CONCURRENCY_CONTROL_NUMBER + 1 | ||
FROM PIMS_PROPERTY prop join | ||
PIMS_PROPERTY_CONTACT cnct ON cnct.PROPERTY_ID = prop.PROPERTY_ID | ||
WHERE cnct.PERSON_ID IS NOT NULL | ||
AND prop.PROPERTY_MANAGER_ID IS NULL | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
-- Migrate the ORGANIZATION_ID data | ||
PRINT N'Migrate the ORGANIZATION_ID data' | ||
GO | ||
UPDATE prop | ||
SET prop.PROP_MGMT_ORG_ID = cnct.ORGANIZATION_ID | ||
, prop.CONCURRENCY_CONTROL_NUMBER = prop.CONCURRENCY_CONTROL_NUMBER + 1 | ||
FROM PIMS_PROPERTY prop join | ||
PIMS_PROPERTY_CONTACT cnct ON cnct.PROPERTY_ID = prop.PROPERTY_ID | ||
WHERE cnct.ORGANIZATION_ID IS NOT NULL | ||
AND prop.PROP_MGMT_ORG_ID IS NULL | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
COMMIT TRANSACTION | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
DECLARE @Success AS BIT | ||
SET @Success = 1 | ||
SET NOEXEC OFF | ||
IF (@Success = 1) PRINT 'The database update succeeded' | ||
ELSE BEGIN | ||
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION | ||
PRINT 'The database update failed' | ||
END | ||
GO |
Binary file modified
BIN
+54.2 KB
(100%)
source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/Schema Compare.zip
Binary file not shown.
Oops, something went wrong.