From c6f8faec7a96eba8324cc0c1abb591adc29d7cce Mon Sep 17 00:00:00 2001 From: Nico Koprowski Date: Tue, 12 Nov 2024 17:16:54 +0800 Subject: [PATCH] fix(Pool): retrieving legacy legal form data --- CHANGELOG.md | 1 + .../org/eclipse/tractusx/bpdm/pool/entity/LegalFormDb.kt | 2 +- .../V6_2_0_4__make_legal_form_active_not_nullable.sql | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 bpdm-pool/src/main/resources/db/migration/V6_2_0_4__make_legal_form_active_not_nullable.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 8116973a8..69df66cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ For changes to the BPDM Helm charts please consult the [changelog](charts/bpdm/C - BPDM Pool: When processing golden record tasks the Pool now ignores isCatenaXMemberData field if it is set to null. ([#1069](https://github.com/eclipse-tractusx/bpdm/issues/1069)) - BPDM Gate: Fixed gate output logic to provide states based on business partner type. - BPDM Cleaning Service Dummy: Removed assignment of uncategorized identifier while performing cleaning task process. +- BPDM Pool: Fix error querying legal forms when non-gleif legacy legal forms are present in the database ([#1107](https://github.com/eclipse-tractusx/bpdm/issues/1107)) ## [6.1.0] - [2024-07-15] diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/LegalFormDb.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/LegalFormDb.kt index aaf463754..d320efe43 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/LegalFormDb.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/LegalFormDb.kt @@ -54,7 +54,7 @@ class LegalFormDb( @JoinColumn(name = "region_id") val administrativeArea: RegionDb?, - @Column(name = "is_active") + @Column(name = "is_active", nullable = false) val isActive: Boolean ) : BaseEntity() diff --git a/bpdm-pool/src/main/resources/db/migration/V6_2_0_4__make_legal_form_active_not_nullable.sql b/bpdm-pool/src/main/resources/db/migration/V6_2_0_4__make_legal_form_active_not_nullable.sql new file mode 100644 index 000000000..bfc0e8243 --- /dev/null +++ b/bpdm-pool/src/main/resources/db/migration/V6_2_0_4__make_legal_form_active_not_nullable.sql @@ -0,0 +1,6 @@ +UPDATE legal_forms +SET is_active = false +WHERE is_active IS NULL; + +ALTER TABLE legal_forms +ALTER COLUMN is_active SET NOT NULL; \ No newline at end of file