From 258a917e43cd682c9b4dd968d9449692e2caa050 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Tue, 22 Jul 2025 20:53:40 +0100 Subject: [PATCH] Remove incorrect default value for particpantId ParticipantReplica.participantId should not have a default value set in the database, as it is a foreign key to Participant table. Issue-ID: POLICY-5422 Change-Id: Ibc855a9cb0b4d55ad5daf9a750bfc1ae24bbcfa3 Signed-off-by: danielhanrahan --- .../1702/downgrade/0500-participantreplica.sql | 20 ++++++++++++++++++++ .../1702/upgrade/0500-participantreplica.sql | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0500-participantreplica.sql create mode 100644 policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0500-participantreplica.sql diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0500-participantreplica.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0500-participantreplica.sql new file mode 100644 index 00000000..a85f6bf9 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0500-participantreplica.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 participantreplica ALTER COLUMN participantId SET DEFAULT ''; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0500-participantreplica.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0500-participantreplica.sql new file mode 100644 index 00000000..294256b9 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0500-participantreplica.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 participantreplica ALTER COLUMN participantId DROP DEFAULT; -- 2.16.6