Fix db-migrator issue when upgrading clamp 89/140389/4
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>
Thu, 6 Mar 2025 10:33:03 +0000 (10:33 +0000)
committerRamesh Murugan Iyer <ramesh.murugan.iyer@est.tech>
Fri, 7 Mar 2025 14:22:20 +0000 (14:22 +0000)
Issue-ID: POLICY-5281
Change-Id: I71e198ed12c8e31c76a1be3a32f43b825fb213ce
Signed-off-by: rameshiyer27 <ramesh.murugan.iyer@est.tech>
policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0100-automationcomposition.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0200-automationcompositionelement.sql [new file with mode: 0644]

diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0100-automationcomposition.sql
new file mode 100644 (file)
index 0000000..e4aae8f
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2025 Nordix Foundation
+ *  ================================================================================
+ *  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=========================================================
+ */
+
+ UPDATE automationcomposition SET substate=0 WHERE substate is NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1601/upgrade/0200-automationcompositionelement.sql
new file mode 100644 (file)
index 0000000..ad9469c
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2025 Nordix Foundation
+ *  ================================================================================
+ *  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=========================================================
+ */
+
+ UPDATE automationcompositionelement SET subState=0 WHERE substate is NULL;
+ UPDATE automationcompositionelement SET stage=0 WHERE stage is NULL;