Add lastUpdate field to support restore DB 45/141545/2
authorFrancescoFioraEst <francesco.fiora@est.tech>
Fri, 4 Jul 2025 14:47:47 +0000 (15:47 +0100)
committerFrancescoFioraEst <francesco.fiora@est.tech>
Fri, 18 Jul 2025 09:48:06 +0000 (10:48 +0100)
Issue-ID: POLICY-5420
Change-Id: I8b05238aba03e320cb4d60b7fc0a8a6255c97214
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0100-automationcomposition.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0200-automationcompositiondefinition.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0100-automationcomposition.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0200-automationcompositiondefinition.sql [new file with mode: 0644]

diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0100-automationcomposition.sql
new file mode 100644 (file)
index 0000000..e030654
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============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=========================================================
+ */
+
+ALTER TABLE automationcomposition DROP lastUpdate;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0200-automationcompositiondefinition.sql
new file mode 100644 (file)
index 0000000..234e93b
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * ============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=========================================================
+ */
+
+ALTER TABLE automationcompositiondefinition DROP lastUpdate;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0100-automationcomposition.sql
new file mode 100644 (file)
index 0000000..246bcde
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * ============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=========================================================
+ */
+
+ALTER TABLE automationcomposition
+ ADD COLUMN lastUpdate VARCHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0200-automationcompositiondefinition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0200-automationcompositiondefinition.sql
new file mode 100644 (file)
index 0000000..cf64529
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * ============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=========================================================
+ */
+
+ALTER TABLE automationcompositiondefinition
+ ADD COLUMN lastUpdate VARCHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';