From 4701b169fb9d7e860889929ce5a2a91ae95b2cbb Mon Sep 17 00:00:00 2001 From: Christophe Loiseau Date: Tue, 20 Aug 2024 10:39:50 +0200 Subject: [PATCH] fix: flyway validation failing in mds variant (#1025) --- CHANGELOG.md | 8 ++++++++ .../de/sovity/edc/extension/postgresql/FlywayFactory.java | 2 ++ launchers/.env.connector | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee5cfc851..7167f23e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,17 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md). - Improve database performance by removing duplicate indexes - The data address is now correctly updated when editing an asset. +- Fix a database initialization error when starting the EDC with Logging House v1.1.0 ### Deployment Migration Notes +#### MDS only + +##### logging-house-client extension + +If the extension is to be switched off, the following must now be set, as the extension is now activated by default when integrated: +- `EDC_LOGGINGHOUSE_EXTENSION_ENABLED: 'false'` + #### Compatible Versions - Connector Backend Docker Images: diff --git a/extensions/postgres-flyway/src/main/java/de/sovity/edc/extension/postgresql/FlywayFactory.java b/extensions/postgres-flyway/src/main/java/de/sovity/edc/extension/postgresql/FlywayFactory.java index a742381be..636983e70 100644 --- a/extensions/postgres-flyway/src/main/java/de/sovity/edc/extension/postgresql/FlywayFactory.java +++ b/extensions/postgres-flyway/src/main/java/de/sovity/edc/extension/postgresql/FlywayFactory.java @@ -39,6 +39,8 @@ public Flyway setupFlywayForUnifiedHistory(DataSource dataSource) { return Flyway.configure() .dataSource(dataSource) .cleanDisabled(!config.flywayCleanEnabled()) + .baselineVersion("0") + .baselineOnMigrate(true) .table("flyway_schema_history") .locations(locations.toArray(new String[0])) .load(); diff --git a/launchers/.env.connector b/launchers/.env.connector index 5b2eb4284..e589980c3 100644 --- a/launchers/.env.connector +++ b/launchers/.env.connector @@ -99,3 +99,8 @@ EDC_VAULT=/app/empty-properties-file.properties # Base URL for the On Request asset datasource, as reachable by the data plane MY_EDC_DATASOURCE_PLACEHOLDER_BASEURL=${EDC_DSP_CALLBACK_ADDRESS} + +# Make the Logging House use the same DB as the EDC +EDC_DATASOURCE_LOGGINGHOUSE_URL=${MY_EDC_JDBC_URL} +EDC_DATASOURCE_LOGGINGHOUSE_USER=${MY_EDC_JDBC_USER} +EDC_DATASOURCE_LOGGINGHOUSE_PASSWORD=${MY_EDC_JDBC_PASSWORD}