diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/LegalEntity.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/LegalEntity.kt index fbaf4e8ce..e59df1589 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/LegalEntity.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/LegalEntity.kt @@ -38,8 +38,8 @@ class LegalEntity( @Column(name = "name_shortname") var shortName: String?, - @Column(name = "legal_form_id", nullable = false) - var legalForm: String?, + @Column(name = "legal_form_id") + var legalForm: String? = null, @Column(name = "data_type") @Enumerated(EnumType.STRING) diff --git a/bpdm-gate/src/main/resources/db/migration/V4_0_0_5__make_legal_form_id_optional.sql b/bpdm-gate/src/main/resources/db/migration/V4_0_0_5__make_legal_form_id_optional.sql new file mode 100644 index 000000000..ba1b527e5 --- /dev/null +++ b/bpdm-gate/src/main/resources/db/migration/V4_0_0_5__make_legal_form_id_optional.sql @@ -0,0 +1,3 @@ +-- Description: Make 'legal_form_id' column optional in the 'legal_entities' table +-- Alter the 'legal_form_id' column to allow NULL values +ALTER TABLE legal_entities ALTER COLUMN legal_form_id DROP NOT NULL;