From dcf0cfb4e05abc4004d21dc98ce7cb032fac36ec Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Dec 2023 11:23:52 +0100 Subject: [PATCH] Bug 35560: DBIC specific --- 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 fffa87b77a1..a32b64f8829 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 b6402955c11..a91c14c9a08 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.34.1