generated from bcgov/MoH-Project-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #115 from bcgov/BCMOHAD-25467-AddFacCivicAddress
add Facility Civic Address to File upload.
- Loading branch information
Showing
4 changed files
with
119 additions
and
66 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
48 changes: 48 additions & 0 deletions
48
backend/app/src/main/resources/db/migration/V5__add_civic_address.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 @@ | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS ( | ||
SELECT 1 | ||
FROM information_schema.columns | ||
WHERE table_name='source_data' and column_name='fac_civic_address' | ||
) THEN | ||
ALTER TABLE source_data | ||
ADD COLUMN fac_civic_address VARCHAR(240); | ||
END IF; | ||
END$$; | ||
|
||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS ( | ||
SELECT 1 | ||
FROM information_schema.columns | ||
WHERE table_name='process_data' and column_name='databc_input_civic_address' | ||
) THEN | ||
ALTER TABLE process_data | ||
ADD COLUMN databc_input_civic_address VARCHAR(240); | ||
END IF; | ||
END$$; | ||
|
||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS ( | ||
SELECT 1 | ||
FROM information_schema.columns | ||
WHERE table_name='process_data' and column_name='databc_output_civic_address' | ||
) THEN | ||
ALTER TABLE process_data | ||
ADD COLUMN databc_output_civic_address VARCHAR(240); | ||
END IF; | ||
END$$; | ||
|
||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS ( | ||
SELECT 1 | ||
FROM table_column_info | ||
WHERE table_name='SOURCE_DATA' and column_name='FAC_CIVIC_ADDRESS' | ||
) THEN | ||
INSERT INTO table_column_info(table_name, column_name, header_name,variable_name, title) VALUES ( | ||
'SOURCE_DATA', 'FAC_CIVIC_ADDRESS', 'FAC_CIVIC_ADDRESS', 'facCivicAddress','Facility Civic Address' | ||
); | ||
END IF; | ||
END$$; |