-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CNDIT-584 Adding Liquibase to Gradle build. Upgrading Gradle to latest * Introducing Liquibase CNDIT-584 Introducing Liquibase
- Loading branch information
Showing
27 changed files
with
164 additions
and
56 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Empty file.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" | ||
xmlns:pro="http://www.liquibase.org/xml/ns/pro" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd | ||
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd | ||
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd"> | ||
|
||
<changeSet id="1" author="liquibase"> | ||
<sqlFile path="src/main/resources/db/report-service-001.sql" /> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
76 changes: 76 additions & 0 deletions
76
report-service/src/main/resources/db/report-service-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,76 @@ | ||
|
||
-- changeset liquibase:1 | ||
-- | ||
-- Creates the tables used by Data Ingestion Service | ||
-- | ||
CREATE TABLE elr_raw ( | ||
id uniqueidentifier DEFAULT newid() NOT NULL, | ||
message_type nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
payload ntext COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
updated_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_on datetime DEFAULT getdate() NOT NULL, | ||
updated_on datetime NULL, | ||
CONSTRAINT PK__elr_raw__3213E83F108B8188 PRIMARY KEY (id) | ||
); | ||
|
||
|
||
CREATE TABLE elr_validated ( | ||
id uniqueidentifier DEFAULT newid() NOT NULL, | ||
raw_message_id uniqueidentifier NULL, | ||
message_type nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
message_version nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, | ||
validated_message ntext COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
updated_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_on datetime DEFAULT getdate() NOT NULL, | ||
updated_on datetime NULL, | ||
hashed_hl7_string varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, | ||
CONSTRAINT PK__elr_vali__3213E83FBDBA6B93 PRIMARY KEY (id) | ||
); | ||
|
||
ALTER TABLE elr_validated ADD CONSTRAINT FK__elr_valid__raw_i__5FB337D6 FOREIGN KEY (raw_message_id) REFERENCES elr_raw(id); | ||
|
||
|
||
CREATE TABLE elr_fhir ( | ||
id uniqueidentifier DEFAULT newid() NOT NULL, | ||
fhir_message nvarchar COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
raw_message_id uniqueidentifier NULL, | ||
created_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
updated_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_on datetime DEFAULT getdate() NOT NULL, | ||
updated_on datetime NULL, | ||
CONSTRAINT PK__elr_fhir__3213E83FC8183E1D PRIMARY KEY (id) | ||
); | ||
|
||
ALTER TABLE elr_fhir ADD CONSTRAINT FK__elr_fhir__raw_me__5AEE82B9 FOREIGN KEY (raw_message_id) REFERENCES elr_raw(id); | ||
|
||
|
||
CREATE TABLE elr_dlt ( | ||
error_message_id uniqueidentifier NOT NULL, | ||
error_message_source nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
error_stack_trace nvarchar COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
error_stack_trace_short nvarchar COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
dlt_status nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
dlt_occurrence int NULL, | ||
message ntext COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
updated_by nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_on datetime DEFAULT getdate() NOT NULL, | ||
updated_on datetime NULL, | ||
CONSTRAINT PK__elr_dlt__CCC56D623E5B71D2 PRIMARY KEY (error_message_id) | ||
); | ||
|
||
|
||
CREATE TABLE clients ( | ||
id uniqueidentifier DEFAULT newid() NOT NULL, | ||
client_id varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
client_secret varchar(512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, | ||
client_roles varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, | ||
created_by varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
updated_by varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, | ||
created_on datetime DEFAULT getdate() NOT NULL, | ||
updated_on datetime NULL, | ||
CONSTRAINT PK__clients__3213E83F1D101DC2 PRIMARY KEY (id), | ||
CONSTRAINT UQ__clients__BF21A425ECA9C5BB UNIQUE (client_id) | ||
); |
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,31 @@ | ||
<configuration> | ||
<!-- Appenders --> | ||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder class="net.logstash.logback.encoder.LogstashEncoder" /> | ||
</appender> | ||
|
||
<appender name="DYNAMIC_FILE" class="gov.cdc.dataingestion.config.LogDynamicFileAppenderConfig"> | ||
<logFilePath>logs/kafka_dlt_error-%d{yyyy-MM-dd}.log</logFilePath> | ||
<append>true</append> | ||
<encoder class="net.logstash.logback.encoder.LogstashEncoder" /> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>ERROR</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>logs/kafka_dlt_error-%d{yyyy-MM-dd}.log</fileNamePattern> | ||
<maxHistory>30</maxHistory> <!-- Number of old log files to keep --> | ||
<totalSizeCap>1GB</totalSizeCap> <!-- Maximum total size of log files --> | ||
</rollingPolicy> | ||
</appender> | ||
|
||
<!-- Loggers --> | ||
<logger name="gov.cdc.dataingestion.kafka.integration.service.KafkaConsumerService" level="INFO"> | ||
<appender-ref ref="DYNAMIC_FILE" /> | ||
</logger> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="CONSOLE" /> | ||
</root> | ||
</configuration> |