Skip to content

Commit

Permalink
adjusted liquibase script
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz committed Dec 5, 2024
1 parent cffc87a commit 4d217d8
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 109 deletions.
17 changes: 13 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
<groupId>org.tkit.onecx.quarkus</groupId>
<artifactId>onecx-tenant</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-oidc-filter</artifactId>
</dependency>

<!-- 1000kit -->
<dependency>
Expand All @@ -32,10 +40,6 @@
<groupId>org.tkit.quarkus.lib</groupId>
<artifactId>tkit-quarkus-jpa-tenant</artifactId>
</dependency>
<dependency>
<groupId>org.tkit.quarkus.lib</groupId>
<artifactId>tkit-quarkus-data-import</artifactId>
</dependency>
<dependency>
<groupId>org.tkit.quarkus.lib</groupId>
<artifactId>tkit-quarkus-jpa</artifactId>
Expand Down Expand Up @@ -157,6 +161,11 @@
<artifactId>tkit-quarkus-test-db-import</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.tkit.quarkus.lib</groupId>
<artifactId>tkit-quarkus-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
10 changes: 2 additions & 8 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ quarkus.hibernate-orm.multitenant=DISCRIMINATOR
quarkus.liquibase.migrate-at-start=true
quarkus.liquibase.validate-on-migrate=true


tkit.dataimport.enabled=false
tkit.dataimport.configurations.chat.file=dev-data.import.json
tkit.dataimport.configurations.chat.metadata.operation=CLEAN_INSERT
tkit.dataimport.configurations.chat.enabled=false
tkit.dataimport.configurations.chat.stop-at-error=true

# enable or disable multi-tenancy support
tkit.rs.context.tenant-id.enabled=false

Expand Down Expand Up @@ -67,5 +60,6 @@ quarkus.test.integration-test-profile=test
%test.quarkus.mockserver.devservices.reuse=true

%test.quarkus.rest-client.onecx_ai_svc.url=${quarkus.mockserver.endpoint}/ai

#%test.quarkus.oidc-client.auth-server-url=${quarkus.oidc.auth-server-url}
quarkus.test.enable-callbacks-for-integration-tests=true
# PIPE CONFIG
1 change: 0 additions & 1 deletion src/main/resources/db/changeLog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">

<include relativeToChangelogFile="true" file="v1/2023-12-01-create-tables.xml"/>
<include relativeToChangelogFile="true" file="v1/2023-12-01-data-import-log.xml"/>

</databaseChangeLog>
135 changes: 63 additions & 72 deletions src/main/resources/db/v1/2023-12-01-create-tables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,81 +6,72 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">

<changeSet author="dev (generated)" id="1701429130534-1">
<changeSet author="dev (generated)" id="1733393832557-1">
<createTable tableName="chat">
<column name="optlock" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="creationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="app_id" type="VARCHAR(255)"/>
<column name="guid" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="chat_pkey"/>
</column>
<column name="summary" type="VARCHAR(255)"/>
<column name="tenant_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="topic" type="VARCHAR(255)"/>
<column name="type" type="VARCHAR(255)"/>
<column name="creationuser" type="VARCHAR(255)"/>
<column name="modificationuser" type="VARCHAR(255)"/>
</createTable>

<createTable tableName="chat">
<column name="optlock" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="creationuser" type="VARCHAR(255)"/>
<column name="creationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationuser" type="VARCHAR(255)"/>
<column name="guid" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="chat_pkey"/>
</column>
<column name="type" type="VARCHAR(255)"/>
<column name="topic" type="VARCHAR(255)"/>
<column name="summary" type="VARCHAR(1000)"/>
<column name="app_id" type="VARCHAR(255)"/>
<column name="tenant_id" type="varchar(255 BYTE)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="dev (generated)" id="1701429130534-2">
<createTable tableName="message">
<column name="optlock" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="reliability" type="FLOAT4"/>
<column name="creationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="chat_id" type="VARCHAR(255)"/>
<column name="guid" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="message_pkey"/>
</column>
<column name="tenant_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="text" type="VARCHAR(255)"/>
<column name="type" type="VARCHAR(255)"/>
<column name="user_name" type="VARCHAR(255)"/>
<column name="creationuser" type="VARCHAR(255)"/>
<column name="modificationuser" type="VARCHAR(255)"/>
</createTable>

<createTable tableName="message">
<column name="optlock" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="creationuser" type="VARCHAR(255)"/>
<column name="creationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationuser" type="VARCHAR(255)"/>
<column name="guid" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="msg_pkey"/>
</column>
<column name="type" type="VARCHAR(255)"/>
<column name="user_name" type="VARCHAR(255)"/>
<column name="text" type="VARCHAR(4000)"/>
<column name="reliability" type="float"/>
<column name="app_id" type="VARCHAR(255)"/>
<column name="tenant_id" type="varchar(255 BYTE)">
<constraints nullable="false"/>
</column>
<column name="chat_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
</createTable>
<addForeignKeyConstraint baseColumnNames="chat_id" baseTableName="message" constraintName="fk_msg2chat" deferrable="false" initiallyDeferred="false" onDelete="CASCADE" onUpdate="NO ACTION" referencedColumnNames="guid" referencedTableName="chat" validate="true"/>
</changeSet>
<changeSet author="dev (generated)" id="1701429130534-3">
<createTable tableName="participant">
<column name="optlock" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="creationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="chat_id" type="VARCHAR(255)"/>
<column name="email" type="VARCHAR(255)"/>
<column name="guid" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="participant_pkey"/>
</column>
<column name="tenant_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="type" type="VARCHAR(255)"/>
<column name="user_id" type="VARCHAR(255)"/>
<column name="user_name" type="VARCHAR(255)"/>
<column name="creationuser" type="VARCHAR(255)"/>
<column name="modificationuser" type="VARCHAR(255)"/>
</createTable>

<createTable tableName="participant">
<column name="optlock" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="creationuser" type="VARCHAR(255)"/>
<column name="creationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationdate" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="modificationuser" type="VARCHAR(255)"/>
<column name="guid" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="participant_pkey"/>
</column>
<column name="type" type="VARCHAR(255)"/>
<column name="user_name" type="VARCHAR(255)"/>
<column name="user_id" type="VARCHAR(255)"/>
<column name="email" type="VARCHAR(255)"/>
<column name="tenant_id" type="varchar(255 BYTE)">
<constraints nullable="false"/>
</column>
<column name="chat_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
</createTable>
<addForeignKeyConstraint baseColumnNames="chat_id" baseTableName="participant" constraintName="fk_participant2chat" deferrable="false" initiallyDeferred="false" onDelete="CASCADE" onUpdate="NO ACTION" referencedColumnNames="guid" referencedTableName="chat" validate="true"/>
</changeSet>
<addForeignKeyConstraint baseColumnNames="chat_id" baseTableName="participant" constraintName="fkcvaqeqxihta97p2n7ev4u4gv2" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="guid" referencedTableName="chat" validate="true"/>
<addForeignKeyConstraint baseColumnNames="chat_id" baseTableName="message" constraintName="fkq0img2rt1ifkedes7rxt7mn24" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="guid" referencedTableName="chat" validate="true"/>
</changeSet>

</databaseChangeLog>

21 changes: 0 additions & 21 deletions src/main/resources/db/v1/2023-12-01-data-import-log.xml

This file was deleted.

Loading

0 comments on commit 4d217d8

Please sign in to comment.