-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #474 from bcgov/1.2.2
Version 1.2.2
- Loading branch information
Showing
8 changed files
with
356 additions
and
7 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
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
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
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
database/V21.1/1_HMR_PDM-dml_CODE_LOOKUP_CHANGE-V20_S1.21.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 @@ | ||
/* ---------------------------------------------------------------------- */ | ||
/* Target DBMS: MS SQL Server 2017 */ | ||
/* Project name: Highway Maintenance Reporting */ | ||
/* Author: Ayodeji Kuponiyi */ | ||
/* Script type: DML */ | ||
/* Created on: 2020-05-11 */ | ||
/* ---------------------------------------------------------------------- */ | ||
|
||
USE HMR_DEV; | ||
|
||
/* Updates | ||
JIRA Ticket: https://jira.th.gov.bc.ca/browse/HMCR-633 | ||
i) Remove major event type as an option from HMR_CODE_LOOKUP. | ||
*/ | ||
|
||
|
||
IF EXISTS | ||
(SELECT * FROM [dbo].[HMR_CODE_LOOKUP] WHERE CODE_SET = 'WRK_RPT_MAINT_TYPE' AND CODE_NAME = 'Major Event') | ||
DELETE [dbo].[HMR_CODE_LOOKUP] WHERE CODE_SET = 'WRK_RPT_MAINT_TYPE' AND CODE_NAME = 'Major Event'; | ||
|
||
GO |
160 changes: 160 additions & 0 deletions
160
database/V21.1/2_HMR_PDM-dml_DELETE_PRD_SUBMISSION_OBJ-V22_S1.22.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,160 @@ | ||
-- ============================================= | ||
-- Author: Ayodeji Kuponiyi | ||
-- Create date: 2020-05-13 | ||
|
||
|
||
|
||
-- Updates: | ||
-- Deleting submission entries in all relevant tables on or before May 06 2020. | ||
-- ============================================= | ||
|
||
USE HMR_DEV; -- uncomment appropriate instance | ||
--USE HMR_TST; | ||
--USE HMR_UAT; | ||
--USE HMR_PRD; | ||
GO | ||
|
||
|
||
DELETE HMR_WORK_REPORT | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
DELETE HMR_WORK_REPORT_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
|
||
DELETE HMR_ROCKFALL_REPORT | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
DELETE HMR_ROCKFALL_REPORT_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
|
||
DELETE HMR_WILDLIFE_REPORT | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
DELETE HMR_WILDLIFE_REPORT_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
DELETE HMR_FEEDBACK_MESSAGE | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_FEEDBACK_MESSAGE.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
|
||
DELETE HMR_SUBMISSION_ROW | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
DELETE HMR_SUBMISSION_ROW_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' | ||
) | ||
|
||
DELETE HMR_SUBMISSION_OBJECT | ||
|
||
WHERE | ||
SERVICE_AREA_NUMBER = 19 | ||
AND FORMAT(APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020' |
164 changes: 164 additions & 0 deletions
164
database/V21.2/1_HMR_PDM-dml_DELETE_PRD_SUBMISSION_OBJ-V22_S1.22-2.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,164 @@ | ||
-- ============================================= | ||
-- Author: Ayodeji Kuponiyi | ||
-- Create date: 2020-05-13 | ||
-- Update date: 2020-05-20 | ||
|
||
|
||
|
||
-- Comments: | ||
-- Original: | ||
--Deleting submission entries in all relevant tables on or before May 06 2020 for SA 19 | ||
-- Updates 2020-05-20: | ||
--Included May 07 and SA 14 | ||
-- ============================================= | ||
|
||
USE HMR_DEV; -- uncomment appropriate instance | ||
--USE HMR_TST; | ||
--USE HMR_UAT; | ||
--USE HMR_PRD; | ||
GO | ||
|
||
|
||
DELETE HMR_WORK_REPORT | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
DELETE HMR_WORK_REPORT_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
|
||
DELETE HMR_ROCKFALL_REPORT | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
DELETE HMR_ROCKFALL_REPORT_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
|
||
DELETE HMR_WILDLIFE_REPORT | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
DELETE HMR_WILDLIFE_REPORT_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
DELETE HMR_FEEDBACK_MESSAGE | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_FEEDBACK_MESSAGE.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
|
||
DELETE HMR_SUBMISSION_ROW | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
DELETE HMR_SUBMISSION_ROW_HIST | ||
|
||
WHERE EXISTS | ||
|
||
( | ||
SELECT * | ||
|
||
FROM [dbo].[HMR_SUBMISSION_OBJECT] so | ||
|
||
WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW_HIST.SUBMISSION_OBJECT_ID | ||
|
||
AND so.SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' | ||
) | ||
|
||
DELETE HMR_SUBMISSION_OBJECT | ||
|
||
WHERE | ||
SERVICE_AREA_NUMBER IN (14,19) | ||
AND FORMAT(APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020' |
Oops, something went wrong.