From 79a50e44ceef0f6e6244ef74d177268e1dee17cc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 5 Apr 2024 08:45:51 +0200 Subject: [PATCH] Bug 35610: DBIC schema changes Signed-off-by: Jonathan Druart (cherry picked from commit 2169d774c14d3ecb1d34464f3a5faa7cb812e75d) Signed-off-by: Fridolin Somers --- Koha/Schema/Result/Branch.pm | 19 +++++++++++++++++-- Koha/Schema/Result/OldReserve.pm | 27 ++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 39c6ce72d3..3a21ff7e1e 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -815,6 +815,21 @@ __PACKAGE__->might_have( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 old_reserves + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "old_reserves", + "Koha::Schema::Result::OldReserve", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 problem_reports Type: has_many @@ -951,8 +966,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-10-19 18:12:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZN7YtRwqkiYZYU1U+Yi+SA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-04-05 06:44:56 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hNniM1Slml6YGmpEa3MJ1w __PACKAGE__->add_columns( '+pickup_location' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index e78ea520c0..b11923d827 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -65,6 +65,7 @@ foreign key from the item_groups table defining if this is an item group level h =head2 branchcode data_type: 'varchar' + is_foreign_key: 1 is_nullable: 1 size: 10 @@ -237,7 +238,7 @@ __PACKAGE__->add_columns( "item_group_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "branchcode", - { data_type => "varchar", is_nullable => 1, size => 10 }, + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, "desk_id", { data_type => "integer", is_nullable => 1 }, "notificationdate", @@ -346,6 +347,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 branchcode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 item_group Type: belongs_to @@ -407,8 +428,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-02-10 14:01:25 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:evv31XLI36n7e+oYL/hsug +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-04-05 06:44:57 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SQp2OEYb3im1x3A+W0h37w __PACKAGE__->belongs_to( "item", -- 2.39.5