From bb225c8be9e911880995aefa40072e3347bd5004 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Tue, 16 Jul 2024 17:07:55 +0100 Subject: 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 --- .../1600/downgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../downgrade/0200-automationcompositionelement.sql | 20 ++++++++++++++++++++ .../1600/upgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../upgrade/0200-automationcompositionelement.sql | 20 ++++++++++++++++++++ .../1600/downgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../downgrade/0200-automationcompositionelement.sql | 20 ++++++++++++++++++++ .../sql/1600/upgrade/0100-automationcomposition.sql | 20 ++++++++++++++++++++ .../upgrade/0200-automationcompositionelement.sql | 20 ++++++++++++++++++++ 8 files changed, 160 insertions(+) create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql (limited to 'policy-db-migrator') 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; -- cgit 1.2.3-korg