From d936cd014cea05207f27b5faede4cf9d1e4c1283 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Fri, 26 Apr 2024 12:44:47 +0100 Subject: 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 --- .../1500/downgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../0200-automationcompositiondefinition.sql | 20 ++++++++++++++++++++ .../postgres/1500/downgrade/0300-participant.sql | 20 ++++++++++++++++++++ .../1500/upgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../upgrade/0200-automationcompositiondefinition.sql | 20 ++++++++++++++++++++ .../postgres/1500/upgrade/0300-participant.sql | 20 ++++++++++++++++++++ .../1500/downgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../0200-automationcompositiondefinition.sql | 20 ++++++++++++++++++++ .../clampacm/sql/1500/downgrade/0300-participant.sql | 20 ++++++++++++++++++++ .../sql/1500/upgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../upgrade/0200-automationcompositiondefinition.sql | 20 ++++++++++++++++++++ .../clampacm/sql/1500/upgrade/0300-participant.sql | 20 ++++++++++++++++++++ 12 files changed, 240 insertions(+) create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0200-automationcompositiondefinition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/downgrade/0300-participant.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0200-automationcompositiondefinition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1500/upgrade/0300-participant.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0200-automationcompositiondefinition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1500/downgrade/0300-participant.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0200-automationcompositiondefinition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1500/upgrade/0300-participant.sql (limited to 'policy-db-migrator/src/main') 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(); -- cgit 1.2.3-korg