generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cnde 2104 - Liquibase for DI, MSGOUTE (ECR) and consolidate Data Sync…
… to use change log (#136) Co-authored-by: [email protected] <[email protected]>
- Loading branch information
1 parent
97d67e7
commit 7252b45
Showing
18 changed files
with
1,102 additions
and
416 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
15 changes: 15 additions & 0 deletions
15
liquibase-service/src/main/resources/db/changelog/db.data_ingest.changelog-16.1.yaml
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,15 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: 0 | ||
author: liquibase | ||
changes: | ||
- sqlFile: | ||
path: 000-dataingest-db-general-001.sql | ||
splitStatements: false | ||
- changeSet: | ||
id: 1 | ||
author: liquibase | ||
changes: | ||
- sqlFile: | ||
path: 001-create_data_ingest_table-001.sql | ||
splitStatements: false |
16 changes: 16 additions & 0 deletions
16
liquibase-service/src/main/resources/db/changelog/db.msgoute.changelog-16.1.yaml
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,16 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: 0 | ||
author: liquibase | ||
changes: | ||
- sqlFile: | ||
path: 000-msgoute-db-general-001.sql | ||
splitStatements: false | ||
- changeSet: | ||
id: 1 | ||
author: liquibase | ||
runOnChange: true | ||
changes: | ||
- sqlFile: | ||
path: 001-alter_nbs_interface-001.sql | ||
splitStatements: false |
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
4 changes: 4 additions & 0 deletions
4
liquibase-service/src/main/resources/db/data_ingest/000-dataingest-db-general-001.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,4 @@ | ||
-- Upgrade compatibility level to allow inbuilt functions such as StringSplit | ||
ALTER | ||
DATABASE NBS_DataIngest SET COMPATIBILITY_LEVEL = 130; | ||
|
79 changes: 79 additions & 0 deletions
79
...ase-service/src/main/resources/db/data_ingest/tables/001-create_data_ingest_table-001.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,79 @@ | ||
IF | ||
NOT EXISTS( | ||
SELECT 'X' | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_NAME = 'elr_raw') | ||
BEGIN | ||
CREATE TABLE elr_raw | ||
( | ||
id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(), | ||
message_type NVARCHAR(255) NOT NULL, | ||
payload NTEXT NOT NULL, | ||
created_by NVARCHAR(255) NOT NULL, | ||
updated_by NVARCHAR(255) NOT NULL, | ||
created_on DATETIME NOT NULL DEFAULT getdate(), | ||
updated_on DATETIME NULL | ||
); | ||
END | ||
|
||
IF | ||
NOT EXISTS( | ||
SELECT 'X' | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_NAME = 'elr_validated') | ||
BEGIN | ||
CREATE TABLE elr_validated | ||
( | ||
id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(), | ||
raw_message_id UNIQUEIDENTIFIER FOREIGN KEY REFERENCES elr_raw (id), | ||
message_type NVARCHAR(255) NOT NULL, | ||
message_version NVARCHAR(255), | ||
validated_message ntext NOT NULL, | ||
hashed_hl7_string varchar(64) NULL, | ||
created_by NVARCHAR(255) NOT NULL, | ||
updated_by NVARCHAR(255) NOT NULL, | ||
created_on DATETIME NOT NULL DEFAULT getdate(), | ||
updated_on DATETIME NULL | ||
); | ||
END | ||
|
||
IF | ||
NOT EXISTS( | ||
SELECT 'X' | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_NAME = 'elr_dlt') | ||
BEGIN | ||
CREATE TABLE elr_dlt | ||
( | ||
error_message_id UNIQUEIDENTIFIER PRIMARY KEY, | ||
error_message_source NVARCHAR(255) NOT NULL, | ||
error_stack_trace NVARCHAR(MAX) NOT NULL, | ||
error_stack_trace_short NVARCHAR(MAX) NOT NULL, | ||
dlt_status NVARCHAR(10) NOT NULL, | ||
dlt_occurrence INT, | ||
message ntext NOT NULL, | ||
created_by NVARCHAR(255) NOT NULL, | ||
updated_by NVARCHAR(255) NOT NULL, | ||
created_on DATETIME NOT NULL DEFAULT getdate(), | ||
updated_on DATETIME NULL | ||
); | ||
END | ||
|
||
|
||
IF | ||
NOT EXISTS( | ||
SELECT 'X' | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE TABLE_NAME = 'elr_record_status_id') | ||
BEGIN | ||
CREATE TABLE elr_record_status_id | ||
( | ||
id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(), | ||
raw_message_id UNIQUEIDENTIFIER FOREIGN KEY REFERENCES elr_raw (id), | ||
nbs_interface_id NVARCHAR(255) NOT NULL, | ||
created_by NVARCHAR(255) NOT NULL, | ||
updated_by NVARCHAR(255) NOT NULL, | ||
created_on DATETIME NOT NULL DEFAULT getdate(), | ||
updated_on DATETIME NULL | ||
); | ||
END |
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
liquibase-service/src/main/resources/db/msgoute/routines/001-alter_nbs_interface-001.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,18 @@ | ||
IF | ||
EXISTS (SELECT 1 FROM sysobjects WHERE name = 'NBS_interface' and xtype = 'U') | ||
BEGIN | ||
|
||
IF | ||
NOT EXISTS(SELECT 1 FROM sys.columns WHERE name = N'original_payload_RR' AND Object_ID = Object_ID(N'NBS_interface')) | ||
BEGIN | ||
ALTER TABLE dbo.NBS_interface | ||
ADD original_payload_RR TEXT; | ||
END; | ||
|
||
IF | ||
NOT EXISTS(SELECT 1 FROM sys.columns WHERE name = N'original_doc_type_cd_RR' AND Object_ID = Object_ID(N'NBS_interface')) | ||
BEGIN | ||
ALTER TABLE dbo.NBS_interface | ||
ADD original_doc_type_cd_RR varchar(100); | ||
END; | ||
END; |
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
liquibase-service/src/main/resources/db/rdb/000-rdb-db-general-001.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,4 @@ | ||
-- Upgrade compatibility level to allow inbuilt functions such as StringSplit | ||
ALTER | ||
DATABASE RDB SET COMPATIBILITY_LEVEL = 130; | ||
|
Oops, something went wrong.