aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2024-12-12 14:44:14 +0000
committerFrancesco Fiora <francesco.fiora@est.tech>2024-12-13 12:29:11 +0000
commit068b44cb2034107b0f922e41a3b7593daa725517 (patch)
treeed08c299acf82b6ea3849564f4b31d537621e903
parent2d1ea7498d5bb12359016ebfb6ad615d34cc4243 (diff)
Fix db-migrator issue in default phase
Fix db-migrator issue when there is an AC instances in transitioning state with TIMEOUT Issue-ID: POLICY-5210 Change-Id: I562a659b74e7ce85db8550ff268ee7845d476eea Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.sql3
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.sql1
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0700-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0800-nodetemplatestate.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql3
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql1
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0700-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0800-nodetemplatestate.sql20
8 files changed, 86 insertions, 2 deletions
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.sql
index 8ef33cbb..c1e4bb43 100644
--- a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.sql
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.sql
@@ -17,4 +17,5 @@
* ============LICENSE_END=========================================================
*/
-ALTER TABLE automationcomposition ADD lastMsg timestamp without time zone DEFAULT Now(), ADD phase SMALLINT;
+ALTER TABLE automationcomposition ADD lastMsg timestamp without time zone DEFAULT Now(), ADD phase SMALLINT DEFAULT 0;
+UPDATE automationcomposition SET restarting = NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.sql
index 66313c04..25a773bd 100644
--- a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.sql
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.sql
@@ -18,3 +18,4 @@
*/
ALTER TABLE automationcompositiondefinition ADD lastMsg timestamp without time zone DEFAULT Now();
+UPDATE automationcompositiondefinition SET restarting = NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0700-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0700-automationcompositionelement.sql
new file mode 100644
index 00000000..03ab8a49
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0700-automationcompositionelement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2024 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 restarting = NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0800-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0800-nodetemplatestate.sql
new file mode 100644
index 00000000..1114a597
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0800-nodetemplatestate.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2024 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 nodetemplatestate SET restarting = NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql
index 103a616c..681b08a1 100644
--- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql
@@ -17,4 +17,5 @@
* ============LICENSE_END=========================================================
*/
-ALTER TABLE automationcomposition ADD lastMsg datetime(6) DEFAULT Now(), ADD phase TINYINT;
+ALTER TABLE automationcomposition ADD lastMsg datetime(6) DEFAULT Now(), ADD phase TINYINT DEFAULT 0;
+UPDATE automationcomposition SET restarting = NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql
index 5a0c05ad..5353558e 100644
--- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql
@@ -18,3 +18,4 @@
*/
ALTER TABLE automationcompositiondefinition ADD lastMsg datetime(6) DEFAULT Now();
+UPDATE automationcompositiondefinition SET restarting = NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0700-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0700-automationcompositionelement.sql
new file mode 100644
index 00000000..03ab8a49
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0700-automationcompositionelement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2024 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 restarting = NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0800-nodetemplatestate.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0800-nodetemplatestate.sql
new file mode 100644
index 00000000..1114a597
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0800-nodetemplatestate.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2024 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 nodetemplatestate SET restarting = NULL;