summaryrefslogtreecommitdiffstats
path: root/policy-db-migrator
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2024-07-16 17:07:55 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2024-07-17 13:47:06 +0000
commitbb225c8be9e911880995aefa40072e3347bd5004 (patch)
tree3f8c998c014c65e1b912e5014e9d3c2a3f86ef7c /policy-db-migrator
parent0b5f65dcc6419218cad5d93ee3b872e7665ab1c6 (diff)
Add DB support for precheck and stage
Add support in DB-migrator for Prepare, Review, Migrate pre-check and stage. Issue-ID: POLICY-5076 Change-Id: I7e422f87436110e1e3c50bf6073907dfd4de5973 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'policy-db-migrator')
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql20
8 files changed, 160 insertions, 0 deletions
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..f0897cfe
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/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 subState;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..ef6f3c79
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-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=========================================================
+ */
+
+ALTER TABLE automationcompositionelement DROP subState, DROP stage;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..b3ec5f96
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/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 subState SMALLINT DEFAULT NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..3e91bbf7
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-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=========================================================
+ */
+
+ALTER TABLE automationcompositionelement ADD subState SMALLINT DEFAULT NULL, ADD stage SMALLINT DEFAULT NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..f0897cfe
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/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 subState;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..ef6f3c79
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-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=========================================================
+ */
+
+ALTER TABLE automationcompositionelement DROP subState, DROP stage;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..7e0fd078
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/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 subState TINYINT DEFAULT NULL NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..06ce9a9d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-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=========================================================
+ */
+
+ALTER TABLE automationcompositionelement ADD subState TINYINT DEFAULT NULL NULL, ADD stage TINYINT DEFAULT NULL NULL;