Remove incorrect default value for particpantId 82/141582/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Tue, 22 Jul 2025 19:53:40 +0000 (20:53 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Wed, 23 Jul 2025 12:41:37 +0000 (13:41 +0100)
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 <daniel.hanrahan@est.tech>
policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/downgrade/0500-participantreplica.sql [new file with mode: 0644]
policy-db-migrator/src/main/docker/config/clampacm/postgres/1702/upgrade/0500-participantreplica.sql [new file with mode: 0644]

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 (file)
index 0000000..a85f6bf
--- /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 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 (file)
index 0000000..294256b
--- /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 participantreplica ALTER COLUMN participantId DROP DEFAULT;