Remove incorrect default value for participantId 13/142413/4
authordanielhanrahan <daniel.hanrahan@est.tech>
Wed, 12 Nov 2025 13:08:44 +0000 (13:08 +0000)
committerRamesh Murugan Iyer <ramesh.murugan.iyer@est.tech>
Fri, 14 Nov 2025 15:36:46 +0000 (15:36 +0000)
ParticipantSupportedAcElements.participantId should not have a default
value set in the database, as it is a foreign key to Participant table

Issue-ID: POLICY-5422
Change-Id: Iecf703b132e5dd2d1d52e009a5335f4fdb0f8a14
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
runtime-acm/src/main/resources/db/changelog/changelog-1801.yaml [new file with mode: 0644]
runtime-acm/src/main/resources/db/changelog/db.changelog-master.yaml
runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/liquibase/LiquibaseRollbackTest.java

diff --git a/runtime-acm/src/main/resources/db/changelog/changelog-1801.yaml b/runtime-acm/src/main/resources/db/changelog/changelog-1801.yaml
new file mode 100644 (file)
index 0000000..798050d
--- /dev/null
@@ -0,0 +1,40 @@
+# ============LICENSE_START=======================================================
+# Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+databaseChangeLog:
+  - objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
+
+  - changeSet:
+      author: policy
+      id: 1801-1
+      changes:
+        - dropDefaultValue:
+            tableName: ParticipantSupportedAcElements
+            columnName: participantId
+      rollback:
+        - addDefaultValue:
+            tableName: ParticipantSupportedAcElements
+            columnName: participantId
+            defaultValue: ''
+
+  - changeSet:
+      id: 1801-tag
+      author: policy
+      changes:
+        - tagDatabase:
+            tag: 1801
index 4474c5d..66ed1e1 100644 (file)
@@ -32,3 +32,5 @@ databaseChangeLog:
       file: db/changelog/changelog-1702.yaml
   - include:
       file: db/changelog/changelog-1800.yaml
+  - include:
+      file: db/changelog/changelog-1801.yaml
index 1919c25..2f997bd 100644 (file)
@@ -143,7 +143,8 @@ class LiquibaseRollbackTest {
                 Arguments.of("1600", "1700"),
                 Arguments.of("1700", "1701"),
                 Arguments.of("1701", "1702"),
-                Arguments.of("1702", "1800")
+                Arguments.of("1702", "1800"),
+                Arguments.of("1800", "1801")
         );
     }