From d8abd8fa14319021c9468348927c0cabe9dc9b07 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 3 May 2024 13:15:27 +0000 Subject: [PATCH] Bug 36120: DBIC schema update Signed-off-by: Katrin Fischer --- Koha/Schema/Result/Booking.pm | 30 ++++++++++++++++++++++++++++-- Koha/Schema/Result/Branch.pm | 19 +++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Booking.pm b/Koha/Schema/Result/Booking.pm index 4c3a971529..73aaa74908 100644 --- a/Koha/Schema/Result/Booking.pm +++ b/Koha/Schema/Result/Booking.pm @@ -57,6 +57,15 @@ foreign key from the biblio table defining which bib record this booking is on foreign key from the items table defining the specific item the patron has placed a booking for +=head2 pickup_library_id + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +Identifier for booking pickup library + =head2 start_date data_type: 'datetime' @@ -94,6 +103,8 @@ __PACKAGE__->add_columns( }, "item_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "pickup_library_id", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, "start_date", { data_type => "datetime", @@ -172,9 +183,24 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 pickup_library + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "pickup_library", + "Koha::Schema::Result::Branch", + { branchcode => "pickup_library_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-04 10:01:46 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LoOYu7IflBkC4+VUZLd+Tg +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-03 13:13:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pgq1xPy2zo3pdkJb801djA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 935cfe1972..c9d55a8182 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -380,6 +380,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 bookings + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bookings", + "Koha::Schema::Result::Booking", + { "foreign.pickup_library_id" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 borrower_attribute_types_branches Type: has_many @@ -981,8 +996,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-04-12 08:58:44 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xp3Kem0f5nkl71jI4sbH3A +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-03 13:13:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HiH1QNlDqKcq9GeM85Pu0A __PACKAGE__->add_columns( '+pickup_location' => { is_boolean => 1 }, -- 2.39.5