From 46424a703d34bbed39e1ad75183352021d14f6e8 Mon Sep 17 00:00:00 2001 From: MatthieuBarbet Date: Wed, 23 Oct 2024 11:21:44 +0200 Subject: [PATCH] Feat: add index in hibernate annotation --- .../src/main/java/io/arlas/persistence/server/model/Data.java | 2 +- docker/docker-files/Dockerfile | 1 - docker/docker-files/Dockerfile-package-only | 1 - docs/arlas-persistence-overview.md | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arlas-persistence-core/src/main/java/io/arlas/persistence/server/model/Data.java b/arlas-persistence-core/src/main/java/io/arlas/persistence/server/model/Data.java index 4549d21..7bd405d 100644 --- a/arlas-persistence-core/src/main/java/io/arlas/persistence/server/model/Data.java +++ b/arlas-persistence-core/src/main/java/io/arlas/persistence/server/model/Data.java @@ -34,7 +34,7 @@ @Entity -@Table(name = "user_data") +@Table(name = "user_data", indexes={@Index(columnList="docKey,docZone,docOrganization",name="doc_key_idx_orga")}) @JsonSnakeCase public class Data { public static final String idColumn = "id"; diff --git a/docker/docker-files/Dockerfile b/docker/docker-files/Dockerfile index b61cc64..b69627d 100644 --- a/docker/docker-files/Dockerfile +++ b/docker/docker-files/Dockerfile @@ -23,7 +23,6 @@ FROM gisaia/arlas-openjdk-17-distroless:20240926175122 WORKDIR /opt/app COPY --from=build /opt/build/arlas-persistence-server.jar /opt/app/ COPY --from=build /opt/build/conf/configuration.yaml /opt/app/ -COPY --from=build /opt/build/docker/docker-files/pgCreateTable.sql /opt/app/ EXPOSE 9997 ENV JDK_JAVA_OPTIONS="-Xmx512m -XX:+ExitOnOutOfMemoryError" diff --git a/docker/docker-files/Dockerfile-package-only b/docker/docker-files/Dockerfile-package-only index d6926e1..6fed6b2 100644 --- a/docker/docker-files/Dockerfile-package-only +++ b/docker/docker-files/Dockerfile-package-only @@ -7,7 +7,6 @@ FROM gisaia/arlas-openjdk-17-distroless:20240926175122 WORKDIR /opt/app ADD arlas-persistence-server/target/arlas-persistence-server*.jar /opt/app/arlas-persistence-server.jar ADD conf/configuration.yaml /opt/app/configuration.yaml -ADD docker/docker-files/pgCreateTable.sql /opt/app/pgCreateTable.sql EXPOSE 9997 ENV JDK_JAVA_OPTIONS="-Xmx512m -XX:+ExitOnOutOfMemoryError" diff --git a/docs/arlas-persistence-overview.md b/docs/arlas-persistence-overview.md index 9e34a65..ce50e91 100644 --- a/docs/arlas-persistence-overview.md +++ b/docs/arlas-persistence-overview.md @@ -5,7 +5,7 @@ Three types of storage are available in this server: - File system storage - All SQL SGBD compliant with hibernate, we use a non configurable unique table [`user_data`](../docker/docker-files/pgCreateTable.sql) in a dedicated configurable database. - ARLAS Persistence WILL NOT CREATE the table for you, think to create table before running the server. + ARLAS Persistence WILL CREATE the database and tables for you. **WARNING** if you want to use this storage, make sure you have the environment variable ``ARLAS_PERSISTENCE_ENGINE`` set to **"hibernate"** with the double quote. - Google Cloud Firestore : think to set GOOGLE_APPLICATION_CREDENTIALS as environement variable.