From ad7e6210bd17dd2ea2d0e2bdae1c2744aee46302 Mon Sep 17 00:00:00 2001 From: Doug Filteau Date: Wed, 24 Jan 2024 17:31:18 -0800 Subject: [PATCH] Added Reordering of the DISPLAY_ORDER Columns (#3742) Reordered the display order following the insertion/deletion of the PIMS_DSP_CHKLST_ITEM_TYPE table. --- .../148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql | 7 +++++++ .../148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql | 7 +++++++ .../148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql | 7 +++++++ .../148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql index 45fe7908c6..e3e2b41e4b 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table. Author Date Comment ------------ ----------- ----------------------------------------------------- Doug Filteau 2024-Jan-10 Initial version +Doug Filteau 2024-Jan-24 Added reordering of display orders ----------------------------------------------------------------------------- */ SET XACT_ABORT ON @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 1 DELETE FROM PIMS_DSP_CHKLST_ITEM_TYPE WHERE DSP_CHKLST_ITEM_TYPE_CODE = @CurrCd; + -- Reorder the display order of the items that follow 'SGNDXFRPPH' + UPDATE PIMS_DSP_CHKLST_ITEM_TYPE + SET DISPLAY_ORDER = DISPLAY_ORDER - 1 + , CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1 + WHERE DISPLAY_ORDER > 23 + AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO' END GO IF @@ERROR <> 0 SET NOEXEC ON diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql index ad5111bb59..6de9ccbd4d 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table. Author Date Comment ------------ ----------- ----------------------------------------------------- Doug Filteau 2024-Jan-10 Initial version +Doug Filteau 2024-Jan-24 Added reordering of display orders ----------------------------------------------------------------------------- */ SET XACT_ABORT ON @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 0 INSERT INTO PIMS_DSP_CHKLST_ITEM_TYPE (DSP_CHKLST_SECTION_TYPE_CODE, DSP_CHKLST_ITEM_TYPE_CODE, DESCRIPTION, DISPLAY_ORDER, HINT) VALUES (N'DIRCTSAL', N'SGNDXFRPPH', N'Signed Transfer Closed PPH Between Gov. Agencies', 24, 'Signed Transfer of Discontinued and Closed Provincial Public Highway Lands To The Minister Responsible'); + -- Reorder the display order of the items that follow 'SGNDXFRPPH' + UPDATE PIMS_DSP_CHKLST_ITEM_TYPE + SET DISPLAY_ORDER = DISPLAY_ORDER + 1 + , CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1 + WHERE DISPLAY_ORDER >= 24 + AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO'; END GO IF @@ERROR <> 0 SET NOEXEC ON diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql index 45fe7908c6..e3e2b41e4b 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Down/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Down.sql @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table. Author Date Comment ------------ ----------- ----------------------------------------------------- Doug Filteau 2024-Jan-10 Initial version +Doug Filteau 2024-Jan-24 Added reordering of display orders ----------------------------------------------------------------------------- */ SET XACT_ABORT ON @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 1 DELETE FROM PIMS_DSP_CHKLST_ITEM_TYPE WHERE DSP_CHKLST_ITEM_TYPE_CODE = @CurrCd; + -- Reorder the display order of the items that follow 'SGNDXFRPPH' + UPDATE PIMS_DSP_CHKLST_ITEM_TYPE + SET DISPLAY_ORDER = DISPLAY_ORDER - 1 + , CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1 + WHERE DISPLAY_ORDER > 23 + AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO' END GO IF @@ERROR <> 0 SET NOEXEC ON diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql index ad5111bb59..6de9ccbd4d 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_S72_00/Alter Up/148_DML_PIMS_DSP_CHKLST_ITEM_TYPE_Alter_Up.sql @@ -4,6 +4,7 @@ Alter the data in the PIMS_DSP_CHKLST_ITEM_TYPE table. Author Date Comment ------------ ----------- ----------------------------------------------------- Doug Filteau 2024-Jan-10 Initial version +Doug Filteau 2024-Jan-24 Added reordering of display orders ----------------------------------------------------------------------------- */ SET XACT_ABORT ON @@ -28,6 +29,12 @@ IF @@ROWCOUNT = 0 INSERT INTO PIMS_DSP_CHKLST_ITEM_TYPE (DSP_CHKLST_SECTION_TYPE_CODE, DSP_CHKLST_ITEM_TYPE_CODE, DESCRIPTION, DISPLAY_ORDER, HINT) VALUES (N'DIRCTSAL', N'SGNDXFRPPH', N'Signed Transfer Closed PPH Between Gov. Agencies', 24, 'Signed Transfer of Discontinued and Closed Provincial Public Highway Lands To The Minister Responsible'); + -- Reorder the display order of the items that follow 'SGNDXFRPPH' + UPDATE PIMS_DSP_CHKLST_ITEM_TYPE + SET DISPLAY_ORDER = DISPLAY_ORDER + 1 + , CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1 + WHERE DISPLAY_ORDER >= 24 + AND DSP_CHKLST_SECTION_TYPE_CODE = N'SALEINFO'; END GO IF @@ERROR <> 0 SET NOEXEC ON