From 50742ec62d8e82c5dfefb34c90da1cd73cedec88 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Dec 2023 11:23:52 +0100 Subject: [PATCH] Bug 35353: DBIC specific Signed-off-by: Matt Blenkinsop Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit 6fb82fd6e32d0f38f24463c31adf546efe153bc3) Signed-off-by: Fridolin Somers --- Koha/Schema/Result/OldReserve.pm | 12 ++++++++++++ Koha/Schema/Result/Reserve.pm | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index b11923d827..cbe46e7881 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -467,6 +467,18 @@ __PACKAGE__->belongs_to( }, ); +__PACKAGE__->belongs_to( + "pickup_library", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + __PACKAGE__->add_columns( '+item_level_hold' => { is_boolean => 1 }, '+lowestPriority' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index b6402955c1..a91c14c9a0 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/Koha/Schema/Result/Reserve.pm @@ -523,4 +523,11 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->belongs_to( + "pickup_library", + "Koha::Schema::Result::Branch", + { "foreign.branchcode" => "self.branchcode" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + 1; -- 2.39.5