Skip to content

Commit

Permalink
script adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz committed Dec 5, 2024
1 parent 4d217d8 commit b1a9ecb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile.jvm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/onecx/docker-quarkus-jvm:0.14.0
FROM ghcr.io/onecx/docker-quarkus-jvm:0.15.0

COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185 target/quarkus-app/*.jar /deployments/
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/github/onecx/chat/domain/models/Chat.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import jakarta.persistence.*;

import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import org.hibernate.annotations.TenantId;
import org.tkit.quarkus.jpa.models.TraceableEntity;

Expand Down Expand Up @@ -35,17 +37,19 @@ public class Chat extends TraceableEntity {
@Column(name = "TOPIC")
private String topic;

@Column(name = "SUMMARY")
@Column(name = "SUMMARY", columnDefinition = "varchar(1000)")
private String summary;

@Column(name = "APP_ID")
private String appId;

@OneToMany(cascade = ALL, fetch = LAZY, mappedBy = "chat", orphanRemoval = true)
@OnDelete(action = OnDeleteAction.CASCADE)
@OrderBy("creationDate ASC")
private Set<Message> messages = new HashSet<>();

@OneToMany(cascade = ALL, fetch = LAZY, mappedBy = "chat", orphanRemoval = true)
@OnDelete(action = OnDeleteAction.CASCADE)
@OrderBy("creationDate ASC")
private Set<Participant> participants = new HashSet<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Message extends TraceableEntity {
@Column(name = "TENANT_ID")
private String tenantId;

@Column(name = "TEXT")
@Column(name = "TEXT", columnDefinition = "varchar(4000)")
private String text;

@Column(name = "TYPE")
Expand Down
17 changes: 9 additions & 8 deletions src/main/resources/db/v1/2023-12-01-create-tables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="1733393832557-1">
<changeSet author="dev (generated)" id="1733402660550-1">
<createTable tableName="chat">
<column name="optlock" type="INTEGER">
<constraints nullable="false"/>
Expand All @@ -17,7 +16,7 @@
<column name="guid" type="VARCHAR(255)">
<constraints nullable="false" primaryKey="true" primaryKeyName="chat_pkey"/>
</column>
<column name="summary" type="VARCHAR(255)"/>
<column name="summary" type="VARCHAR(1000)"/>
<column name="tenant_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
Expand All @@ -41,7 +40,7 @@
<column name="tenant_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="text" type="VARCHAR(255)"/>
<column name="text" type="VARCHAR(4000)"/>
<column name="type" type="VARCHAR(255)"/>
<column name="user_name" type="VARCHAR(255)"/>
<column name="creationuser" type="VARCHAR(255)"/>
Expand Down Expand Up @@ -69,9 +68,11 @@
<column name="modificationuser" type="VARCHAR(255)"/>
</createTable>

<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>
<addForeignKeyConstraint baseColumnNames="chat_id" baseTableName="participant" constraintName="fkcvaqeqxihta97p2n7ev4u4gv2" deferrable="false" initiallyDeferred="false"
onDelete="CASCADE" onUpdate="NO ACTION" referencedColumnNames="guid" referencedTableName="chat" validate="true"/>

</databaseChangeLog>
<addForeignKeyConstraint baseColumnNames="chat_id" baseTableName="message" constraintName="fkq0img2rt1ifkedes7rxt7mn24" deferrable="false" initiallyDeferred="false"
onDelete="CASCADE" onUpdate="NO ACTION" referencedColumnNames="guid" referencedTableName="chat" validate="true"/>
</changeSet>
</databaseChangeLog>

0 comments on commit b1a9ecb

Please sign in to comment.