From: danielhanrahan Date: Mon, 10 Nov 2025 14:02:42 +0000 (+0000) Subject: Fix for Liquibase upgrade failure due to NULL participantId X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=5c05acc556e8f35d0809edf0e35e19e27f7389c4;p=policy%2Fclamp.git Fix for Liquibase upgrade failure due to NULL participantId This fixes an intermittent upgrade issue when adding not-null constraints to participant tables due to orphan entries with NULL values. The fix is to delete rows with NULL entries before adding the NOT NULL constraints. Since the changesets may have already been deployed, we need to override the checksums to avoid Liquibase checksum validation errors. Issue-ID: POLICY-5486 Change-Id: Ic60b536a1118c3f22e32f04ef0d1c573917c0d20 Signed-off-by: danielhanrahan --- diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1701.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1701.yaml index 26ed1d4a9..56e95d3cd 100644 --- a/runtime-acm/src/main/resources/db/changelog/changelog-1701.yaml +++ b/runtime-acm/src/main/resources/db/changelog/changelog-1701.yaml @@ -680,11 +680,17 @@ databaseChangeLog: - changeSet: id: 1701-28 author: policy + # The checksum is needed as this changeset was modified after release to add the delete step. + # Otherwise, Liquibase would fail with a checksum validation error when applying to an existing DB. + validCheckSum: 9:8ee2b3be1395cf06a05b91faf74b3f80 changes: - addDefaultValue: tableName: ParticipantReplica columnName: participantId defaultValue: '' + - delete: + tableName: ParticipantReplica + where: participantId IS NULL - addNotNullConstraint: tableName: ParticipantReplica columnName: participantId @@ -725,11 +731,17 @@ databaseChangeLog: - changeSet: id: 1701-30 author: policy + # The checksum is needed as this changeset was modified after release to add the delete step. + # Otherwise, Liquibase would fail with a checksum validation error when applying to an existing DB. + validCheckSum: 9:705a8c5532630d8a332c4ecc75952a30 changes: - addDefaultValue: tableName: ParticipantSupportedAcElements columnName: participantId defaultValue: '' + - delete: + tableName: ParticipantSupportedAcElements + where: participantId IS NULL - addNotNullConstraint: tableName: ParticipantSupportedAcElements columnName: participantId