aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2024-04-26 12:44:47 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2024-05-28 12:22:51 +0000
commitd936cd014cea05207f27b5faede4cf9d1e4c1283 (patch)
treece33991a64fab01af28490d268f033706f5f2530
parentb564b01e9de12c5a20d65f5dd3060f6472ebe275 (diff)
Add startPhase and timeout support in db-migrator for ACM-runtime
Add support for startPhase and timeout using db instead of HashMap in memory for ACM-R. Issue-ID: POLICY-5023 Change-Id: I0c2d78f030139980e150afb04457aeef9a73f6ab Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0200-automationcompositiondefinition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0300-participant.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0300-participant.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0300-participant.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participant.sql20
12 files changed, 240 insertions, 0 deletions
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..a4263782
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0100-automationcomposition.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=========================================================
+ */
+
+ALTER TABLE automationcomposition DROP lastMsg, DROP phase;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0200-automationcompositiondefinition.sql
new file mode 100644
index 00000000..cac95376
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0200-automationcompositiondefinition.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=========================================================
+ */
+
+ALTER TABLE automationcompositiondefinition DROP lastMsg;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0300-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0300-participant.sql
new file mode 100644
index 00000000..10ddaaf6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0300-participant.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=========================================================
+ */
+
+ALTER TABLE participant DROP lastMsg;
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
new file mode 100644
index 00000000..e0cbb692
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.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=========================================================
+ */
+
+ALTER TABLE automationcomposition ADD lastMsg timestamp without time zone, ADD phase SMALLINT;
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
new file mode 100644
index 00000000..2c8d382a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.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=========================================================
+ */
+
+ALTER TABLE automationcompositiondefinition ADD lastMsg timestamp without time zone;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0300-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0300-participant.sql
new file mode 100644
index 00000000..97ae43a3
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0300-participant.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=========================================================
+ */
+
+ALTER TABLE participant ADD lastMsg timestamp without time zone DEFAULT Now();
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..a4263782
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0100-automationcomposition.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=========================================================
+ */
+
+ALTER TABLE automationcomposition DROP lastMsg, DROP phase;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.sql
new file mode 100644
index 00000000..cac95376
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.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=========================================================
+ */
+
+ALTER TABLE automationcompositiondefinition DROP lastMsg;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0300-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0300-participant.sql
new file mode 100644
index 00000000..10ddaaf6
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0300-participant.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=========================================================
+ */
+
+ALTER TABLE participant DROP lastMsg;
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
new file mode 100644
index 00000000..933e4bda
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.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=========================================================
+ */
+
+ALTER TABLE automationcomposition ADD lastMsg datetime(6), ADD phase TINYINT;
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
new file mode 100644
index 00000000..0f0af093
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.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=========================================================
+ */
+
+ALTER TABLE automationcompositiondefinition ADD lastMsg datetime(6);
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participant.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participant.sql
new file mode 100644
index 00000000..042c454a
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participant.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=========================================================
+ */
+
+ALTER TABLE participant ADD lastMsg datetime(6) DEFAULT Now();