From 400a09e5dc6f5ed92e45a20be7c17d6de2cecb8d Mon Sep 17 00:00:00 2001 From: rob-ouser-bi Date: Tue, 20 Aug 2024 20:25:14 +0000 Subject: [PATCH 1/2] [autocommit] bumping build number --- src/main/resources/version.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/version.properties b/src/main/resources/version.properties index 4615b0d66..cc80c1238 100644 --- a/src/main/resources/version.properties +++ b/src/main/resources/version.properties @@ -14,5 +14,5 @@ # limitations under the License. # -version=v0.10.0+790 -versionInfo=https://github.com/Breeding-Insight/bi-api/commit/026884428e9df6a25869e63339395c3602ef5a39 +version=v0.10.0+792 +versionInfo=https://github.com/Breeding-Insight/bi-api/commit/ff9abc7fb9fca3af818f696513a119123add685a From 32e19c76d57753f36d272957a32a53646b9d4cd8 Mon Sep 17 00:00:00 2001 From: mlm483 <128052931+mlm483@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:55:00 -0400 Subject: [PATCH 2/2] [BI-2283] - add fix_fk_constraint migration make foreign key constraint cascade on delete --- .../migration/V1.27.0__fix_fk_constraint.sql | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/main/resources/db/migration/V1.27.0__fix_fk_constraint.sql diff --git a/src/main/resources/db/migration/V1.27.0__fix_fk_constraint.sql b/src/main/resources/db/migration/V1.27.0__fix_fk_constraint.sql new file mode 100644 index 000000000..f6b680464 --- /dev/null +++ b/src/main/resources/db/migration/V1.27.0__fix_fk_constraint.sql @@ -0,0 +1,27 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * 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. + */ + +DO $$ +BEGIN + -- Drop foreign key constraint (can't directly alter ON DELETE behavior). + ALTER TABLE experiment_program_user_role DROP CONSTRAINT experiment_program_user_role_program_user_role_id_fkey; + -- Add foreign key constraint with ON DELETE CASCADE. + ALTER TABLE experiment_program_user_role + ADD CONSTRAINT experiment_program_user_role_program_user_role_id_fkey + FOREIGN KEY (program_user_role_id) REFERENCES program_user_role (id) + ON DELETE CASCADE; +END $$;