From c8bfaa452c478304292ddfd68e84257f27f5e299 Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Wed, 4 Dec 2024 14:29:07 +0100 Subject: [PATCH] fix: add default empty array value for null policy profiles --- docs/migration/Version_0.7.x_0.8.x.md | 5 ++++- .../policy/V0_0_6__Avoid_null_profiles.sql | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/policy/V0_0_6__Avoid_null_profiles.sql diff --git a/docs/migration/Version_0.7.x_0.8.x.md b/docs/migration/Version_0.7.x_0.8.x.md index b79d0ff57..e75a0a4b7 100644 --- a/docs/migration/Version_0.7.x_0.8.x.md +++ b/docs/migration/Version_0.7.x_0.8.x.md @@ -38,6 +38,9 @@ For those who are not using either the Helm Charts or the provided [`migration` - [federated catalog - init schema](../../edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/federatedcatalog/V0_0_1__Init_FederatedCatalogCache_Database_Schema.sql) - [policy monitor - create state index](../../edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/policy-monitor/V0_0_2__Alter_PolicyMonitor_CreateStateIndex.sql) - [policy definition - add profiles column](../../edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/policy/V0_0_5__Add_Profiles.sql) + - **WARNING**: in version 0.8.0 this could give runtime errors, eventually you can manually run the query contained in the + [subsequent migration](../../edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/policy/V0_0_6__Avoid_null_profiles.sql). + The migration fix will be available from 0.8.1 on. - [transfer process - create state index](../../edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/transferprocess/V0_0_16__Alter_TransferProcess_CreateStateIndex.sql) ### 2.2. Data plane: @@ -99,4 +102,4 @@ of the helm charts in error. -java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter -java.util.logging.ConsoleHandler.level=ALL -java.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS] [%4$-7s] %5$s%6$s%n -``` \ No newline at end of file +``` diff --git a/edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/policy/V0_0_6__Avoid_null_profiles.sql b/edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/policy/V0_0_6__Avoid_null_profiles.sql new file mode 100644 index 000000000..ca05e79c9 --- /dev/null +++ b/edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/policy/V0_0_6__Avoid_null_profiles.sql @@ -0,0 +1,14 @@ +-- +-- Copyright (c) 2024 Contributors to the Eclipse Foundation +-- +-- This program and the accompanying materials are made available under the +-- terms of the Apache License, Version 2.0 which is available at +-- https://www.apache.org/licenses/LICENSE-2.0 +-- +-- SPDX-License-Identifier: Apache-2.0 +-- +-- Contributors: +-- Contributors to the Eclipse Foundation - initial API and implementation +-- + +UPDATE edc_policydefinitions SET profiles='[]'::json where profiles is NULL;