From: FrancescoFioraEst Date: Fri, 4 Jul 2025 14:47:47 +0000 (+0100) Subject: Add lastUpdate field to support restore DB X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=fa11a90cf2db46061ad5190f2d82e881bc3acfbc;p=policy%2Fdocker.git Add lastUpdate field to support restore DB Issue-ID: POLICY-5420 Change-Id: I8b05238aba03e320cb4d60b7fc0a8a6255c97214 Signed-off-by: FrancescoFioraEst --- 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 index 00000000..e0306546 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0100-automationcomposition.sql @@ -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 index 00000000..234e93be --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0200-automationcompositiondefinition.sql @@ -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 index 00000000..246bcde9 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0100-automationcomposition.sql @@ -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 index 00000000..cf64529f --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0200-automationcompositiondefinition.sql @@ -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';