From 51b7b70197c5d4e15d00ebe1ab7ebd9f77b3a028 Mon Sep 17 00:00:00 2001 From: JordenReuter <149687553+JordenReuter@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:18:24 +0100 Subject: [PATCH] feat: renamed tables and columns (#74) --- .../pages/onecx-parameter-svc-extensions.adoc | 72 +++++++++---------- .../pages/onecx-parameter-svc.adoc | 24 ++++--- .../domain/models/ApplicationParameter.java | 19 +++-- .../models/ApplicationParameterHistory.java | 8 +-- src/main/resources/application.properties | 4 +- .../resources/db/18-11-2024-rename-tables.xml | 56 +++++++++++++++ src/main/resources/db/changeLog.xml | 1 + src/test/resources/data/history-testdata.xml | 20 +++--- .../data/parameters-dao-testdata.xml | 6 +- .../resources/data/parameters-importdata.xml | 2 +- .../resources/data/parameters-testdata.xml | 30 ++++---- 11 files changed, 150 insertions(+), 92 deletions(-) create mode 100644 src/main/resources/db/18-11-2024-rename-tables.xml diff --git a/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc-extensions.adoc b/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc-extensions.adoc index 277cf7c..ace52cf 100644 --- a/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc-extensions.adoc +++ b/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc-extensions.adoc @@ -11,159 +11,159 @@ h| Version | tkit-quarkus-data-import | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-data-import.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-data-import.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-data-import.adoc[Link] +| 2.36.0 | tkit-quarkus-jpa | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-jpa.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] +| 2.36.0 | tkit-quarkus-log-cdi | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-cdi.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] +| 2.36.0 | tkit-quarkus-log-rs | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-rs.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] +| 2.36.0 | tkit-quarkus-log-json | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-json.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] +| 2.36.0 | tkit-quarkus-rest | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] +| 2.36.0 | onecx-tenant | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-tenant.html[Link] -| https://github.com/onecx/onecx-quarkus/blob/0.24.0/docs/modules/onecx-quarkus/pages/includes/onecx-tenant.adoc[Link] -| 0.24.0 +| https://github.com/onecx/onecx-quarkus/blob/0.34.0/docs/modules/onecx-quarkus/pages/includes/onecx-tenant.adoc[Link] +| 0.34.0 | tkit-quarkus-jpa-tenant | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-jpa-tenant.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa-tenant.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa-tenant.adoc[Link] +| 2.36.0 | tkit-quarkus-rest-context | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest-context.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] +| 2.36.0 | quarkus-oidc | https://quarkus.io/guides/security-oidc-bearer-token-authentication-tutorial[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-oidc.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-arc | https://quarkus.io/guides/cdi-reference[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-arc.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-liquibase | https://quarkus.io/guides/liquibase[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-liquibase.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-smallrye-health | https://quarkus.io/guides/smallrye-health[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-health.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-micrometer-registry-prometheus | https://quarkus.io/guides/telemetry-micrometer[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-micrometer-registry-prometheus.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-hibernate-orm | https://quarkus.io/guides/hibernate-orm[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-hibernate-orm.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-rest | https://quarkus.io/guides/rest[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-rest.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-rest-jackson | https://quarkus.io/guides/rest-json[Link] | -| 3.12.2 +| 3.15.1 | quarkus-jdbc-postgresql | https://quarkus.io/guides/datasource[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-jdbc-postgresql.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-smallrye-openapi | https://quarkus.io/guides/openapi-swaggerui[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-openapi.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-hibernate-validator | https://quarkus.io/guides/validation[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-hibernate-validator.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-opentelemetry | https://quarkus.io/guides/opentelemetry[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-opentelemetry.adoc[Link] -| 3.12.2 +| 3.15.1 | tkit-quarkus-security | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-security.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] +| 2.36.0 | onecx-core | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link] | -| 0.24.0 +| 0.34.0 | quarkus-container-image-docker | https://quarkus.io/guides/container-image[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-container-image-docker.adoc[Link] -| 3.12.2 +| 3.15.1 | onecx-security | | -| 0.24.0 +| 0.34.0 | quarkus-scheduler | | -| 3.12.2 +| 3.15.1 |=== \ No newline at end of file diff --git a/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc.adoc b/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc.adoc index 1a39a09..1272604 100644 --- a/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc.adoc +++ b/docs/modules/onecx-parameter-svc/pages/onecx-parameter-svc.adoc @@ -1,46 +1,48 @@ - :summaryTableId: onecx-parameter-svc [.configuration-legend] icon:lock[title=Fixed at build time] Configuration property fixed at build time - All other configuration properties are overridable at runtime [.configuration-reference.searchable, cols="80,.^10,.^10"] |=== -h|[[onecx-parameter-svc_configuration]]link:#onecx-parameter-svc_configuration[Configuration property] - +h|[.header-title]##Configuration property## h|Type h|Default -a| [[onecx-parameter-svc_onecx-parameter-scheduler-duration]]`link:#onecx-parameter-svc_onecx-parameter-scheduler-duration[onecx.parameter.scheduler.duration]` - +a| [[onecx-parameter-svc_onecx-parameter-scheduler-duration]] [.property-path]##link:#onecx-parameter-svc_onecx-parameter-scheduler-duration[`onecx.parameter.scheduler.duration`]## [.description] -- Scheduler duration in days + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++ONECX_PARAMETER_SCHEDULER_DURATION+++[] endif::add-copy-button-to-env-var[] ifndef::add-copy-button-to-env-var[] Environment variable: `+++ONECX_PARAMETER_SCHEDULER_DURATION+++` endif::add-copy-button-to-env-var[] ---|string +-- +|string |`7` - -a| [[onecx-parameter-svc_onecx-parameter-scheduler-expression]]`link:#onecx-parameter-svc_onecx-parameter-scheduler-expression[onecx.parameter.scheduler.expression]` - +a| [[onecx-parameter-svc_onecx-parameter-scheduler-expression]] [.property-path]##link:#onecx-parameter-svc_onecx-parameter-scheduler-expression[`onecx.parameter.scheduler.expression`]## [.description] -- Scheduler expression + ifdef::add-copy-button-to-env-var[] Environment variable: env_var_with_copy_button:+++ONECX_PARAMETER_SCHEDULER_EXPRESSION+++[] endif::add-copy-button-to-env-var[] ifndef::add-copy-button-to-env-var[] Environment variable: `+++ONECX_PARAMETER_SCHEDULER_EXPRESSION+++` endif::add-copy-button-to-env-var[] ---|string +-- +|string |`0 15 2 * * ?` -|=== \ No newline at end of file +|=== + + +:!summaryTableId: \ No newline at end of file diff --git a/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameter.java b/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameter.java index b90cc7e..446d9bf 100644 --- a/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameter.java +++ b/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameter.java @@ -1,9 +1,6 @@ package org.tkit.onecx.parameters.domain.models; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.Table; -import jakarta.persistence.UniqueConstraint; +import jakarta.persistence.*; import org.hibernate.annotations.TenantId; import org.tkit.quarkus.jpa.models.TraceableEntity; @@ -14,8 +11,8 @@ @Getter @Setter @Entity -@Table(name = "APM_APP_PARAM", uniqueConstraints = { - @UniqueConstraint(columnNames = { "APPLICATION_ID", "PRODUCT_NAME", "PARAM_KEY", "TENANT_ID" }) }) +@Table(name = "PARAMETER", uniqueConstraints = { + @UniqueConstraint(columnNames = { "KEY", "APPLICATION_ID", "PRODUCT_NAME", "TENANT_ID" }) }) @SuppressWarnings("java:S2160") public class ApplicationParameter extends TraceableEntity { @@ -31,20 +28,20 @@ public class ApplicationParameter extends TraceableEntity { /** * The application parameter key. */ - @Column(name = "PARAM_KEY") + @Column(name = "KEY") private String key; /** * The application parameter name. */ - @Column(name = "PARAM_NAME") + @Column(name = "NAME") private String name; /** * The name of the parameter as it appears in functional specifications * (FSS). */ - @Column(name = "PARAM_DESCRIPTION") + @Column(name = "DESCRIPTION") private String description; /** @@ -62,12 +59,12 @@ public class ApplicationParameter extends TraceableEntity { /** * The application parameter set value. */ - @Column(name = "SET_VALUE") + @Column(name = "SET_VALUE", columnDefinition = "varchar(1000)") private String setValue; /** * The application parameter set value. */ - @Column(name = "IMPORT_VALUE") + @Column(name = "IMPORT_VALUE", columnDefinition = "varchar(1000)") private String importValue; } diff --git a/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameterHistory.java b/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameterHistory.java index 857e637..c14644d 100644 --- a/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameterHistory.java +++ b/src/main/java/org/tkit/onecx/parameters/domain/models/ApplicationParameterHistory.java @@ -15,7 +15,7 @@ @Getter @Setter @Entity -@Table(name = "APM_APP_PARAM_HISTORY") +@Table(name = "PARAMETER_HISTORY") @SuppressWarnings("java:S2160") public class ApplicationParameterHistory extends TraceableEntity { @@ -31,7 +31,7 @@ public class ApplicationParameterHistory extends TraceableEntity { /** * The application parameter key. */ - @Column(name = "PARAM_KEY") + @Column(name = "KEY") private String key; /** @@ -55,13 +55,13 @@ public class ApplicationParameterHistory extends TraceableEntity { /** * The application parameter used value. */ - @Column(name = "USED_VALUE") + @Column(name = "USED_VALUE", columnDefinition = "varchar(1000)") private String usedValue; /** * The application parameter used value. */ - @Column(name = "DEFAULT_VALUE") + @Column(name = "DEFAULT_VALUE", columnDefinition = "varchar(1000)") private String defaultValue; /** diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3df0437..8734bb1 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -27,14 +27,16 @@ tkit.rs.context.tenant-id.enabled=true %test.quarkus.scheduler.enabled=false # Enable mocking for tenant service %test.tkit.jpa.tenant.default=tenant-100 +%test.tkit.rs.context.tenant-id.enabled=true %test.tkit.rs.context.tenant-id.mock.enabled=true %test.tkit.rs.context.tenant-id.mock.default-tenant=tenant-100 %test.tkit.rs.context.tenant-id.mock.claim-org-id=orgId %test.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 %test.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 +%test.smallrye.jwt.verify.key.location=${keycloak.url}/realms/quarkus/protocol/openid-connect/certs +%test.tkit.rs.context.token.header-param=apm-principal-token # set JSON console formatting extension. %test.tkit.log.json.enabled=false - quarkus.test.integration-test-profile=test quarkus.test.enable-callbacks-for-integration-tests=true diff --git a/src/main/resources/db/18-11-2024-rename-tables.xml b/src/main/resources/db/18-11-2024-rename-tables.xml new file mode 100644 index 0000000..40c1bcb --- /dev/null +++ b/src/main/resources/db/18-11-2024-rename-tables.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/db/changeLog.xml b/src/main/resources/db/changeLog.xml index f209f21..4b825a1 100644 --- a/src/main/resources/db/changeLog.xml +++ b/src/main/resources/db/changeLog.xml @@ -7,4 +7,5 @@ + diff --git a/src/test/resources/data/history-testdata.xml b/src/test/resources/data/history-testdata.xml index ec14248..0090935 100644 --- a/src/test/resources/data/history-testdata.xml +++ b/src/test/resources/data/history-testdata.xml @@ -1,14 +1,14 @@ - - - - - - - - + + + + + + + + - - + + \ No newline at end of file diff --git a/src/test/resources/data/parameters-dao-testdata.xml b/src/test/resources/data/parameters-dao-testdata.xml index e56d505..b1e43cb 100644 --- a/src/test/resources/data/parameters-dao-testdata.xml +++ b/src/test/resources/data/parameters-dao-testdata.xml @@ -1,6 +1,6 @@ - - - + + + \ No newline at end of file diff --git a/src/test/resources/data/parameters-importdata.xml b/src/test/resources/data/parameters-importdata.xml index 6b189e1..a8b01d9 100644 --- a/src/test/resources/data/parameters-importdata.xml +++ b/src/test/resources/data/parameters-importdata.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/test/resources/data/parameters-testdata.xml b/src/test/resources/data/parameters-testdata.xml index 67bd4f9..7dee31d 100644 --- a/src/test/resources/data/parameters-testdata.xml +++ b/src/test/resources/data/parameters-testdata.xml @@ -1,23 +1,23 @@ - - - - - + + + + + - + - - + + - - - + + + - - - - + + + + \ No newline at end of file