generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Orv2-2040 - Refactor Frontend Permit and Application Types and Logic (#…
…1261) Co-authored-by: zgong-gov <[email protected]>
- Loading branch information
Showing
91 changed files
with
1,846 additions
and
1,325 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
database/mssql/scripts/versions/revert/v_21_ddl_revert.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,58 @@ | ||
SET ANSI_NULLS ON | ||
GO | ||
SET QUOTED_IDENTIFIER ON | ||
GO | ||
SET NOCOUNT ON | ||
GO | ||
|
||
SET XACT_ABORT ON | ||
GO | ||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE | ||
GO | ||
BEGIN TRANSACTION | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
ALTER TABLE [permit].[ORBC_PERMIT_DATA] | ||
DROP COLUMN VIN | ||
|
||
|
||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
ALTER TABLE [permit].[ORBC_PERMIT_DATA] | ||
ADD [APPLICANT] AS (CONCAT (json_value([PERMIT_DATA],'$.contactDetails.firstName'), ' ', json_value([PERMIT_DATA],'$.contactDetails.lastName'))) | ||
|
||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
EXEC sys.sp_addextendedproperty | ||
@name=N'MS_Description', | ||
@value=N'Calculated column for the applicant full name, pulled from the JSON PERMIT_DATA.', | ||
@level0type=N'SCHEMA', | ||
@level0name=N'permit', | ||
@level1type=N'TABLE', | ||
@level1name=N'ORBC_PERMIT_DATA', | ||
@level2type=N'COLUMN', | ||
@level2name=N'APPLICANT' | ||
GO | ||
|
||
DECLARE @VersionDescription VARCHAR(255) | ||
SET @VersionDescription = 'Reverting addition of new columns to ORBC_PERMIT_DATA table' | ||
|
||
INSERT [dbo].[ORBC_SYS_VERSION] ([VERSION_ID], [DESCRIPTION], [RELEASE_DATE]) VALUES (20, @VersionDescription, getutcdate()) | ||
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 |
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,64 @@ | ||
SET ANSI_NULLS ON | ||
GO | ||
SET QUOTED_IDENTIFIER ON | ||
GO | ||
SET NOCOUNT ON | ||
GO | ||
|
||
SET XACT_ABORT ON | ||
GO | ||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE | ||
GO | ||
BEGIN TRANSACTION | ||
GO | ||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
ALTER TABLE [permit].[ORBC_PERMIT_DATA] | ||
ADD [VIN] AS (json_value([PERMIT_DATA],'$.vehicleDetails.vin')) | ||
|
||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
ALTER TABLE [permit].[ORBC_PERMIT_DATA] | ||
DROP COLUMN APPLICANT | ||
GO | ||
|
||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
EXEC sys.sp_addextendedproperty | ||
@name=N'MS_Description', | ||
@value=N'Calculated column for the vehicle VIN, pulled from the JSON PERMIT_DATA.', | ||
@level0type=N'SCHEMA', | ||
@level0name=N'permit', | ||
@level1type=N'TABLE', | ||
@level1name=N'ORBC_PERMIT_DATA', | ||
@level2type=N'COLUMN', | ||
@level2name=N'VIN' | ||
GO | ||
|
||
IF @@ERROR <> 0 SET NOEXEC ON | ||
GO | ||
|
||
DECLARE @VersionDescription VARCHAR(255) | ||
SET @VersionDescription = 'Add VIN derived column to Permit Data and drop APPLICANT column' | ||
|
||
INSERT [dbo].[ORBC_SYS_VERSION] ([VERSION_ID], [DESCRIPTION], [UPDATE_SCRIPT], [REVERT_SCRIPT], [RELEASE_DATE]) VALUES (21, @VersionDescription, '$(UPDATE_SCRIPT)', '$(REVERT_SCRIPT)', getutcdate()) | ||
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 | ||
|
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
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
Oops, something went wrong.