From 0af45349b5335681b2dd4afe2281a31ba487969e Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Thu, 28 Jul 2022 14:13:01 -0400 Subject: [PATCH] Bug 24860: Update existing Schema files [DO NOT PUSH] --- Koha/Schema/Result/ItemGroup.pm | 34 ++++++++++++++++++++++++++++++-- Koha/Schema/Result/OldReserve.pm | 34 ++++++++++++++++++++++++++++++-- Koha/Schema/Result/Reserve.pm | 34 ++++++++++++++++++++++++++++++-- 3 files changed, 96 insertions(+), 6 deletions(-) diff --git a/Koha/Schema/Result/ItemGroup.pm b/Koha/Schema/Result/ItemGroup.pm index 9e4bf7b04b7..f92e0ecaa9a 100644 --- a/Koha/Schema/Result/ItemGroup.pm +++ b/Koha/Schema/Result/ItemGroup.pm @@ -147,9 +147,39 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 old_reserves -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-02 16:18:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YO7VdfzHDqBjGHt7vQX7gw +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "old_reserves", + "Koha::Schema::Result::OldReserve", + { "foreign.item_group_id" => "self.item_group_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 reserves + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "reserves", + "Koha::Schema::Result::Reserve", + { "foreign.item_group_id" => "self.item_group_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-28 18:11:37 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7E4YokAG1YYBFNyth/HoEw sub koha_objects_class { 'Koha::Biblio::ItemGroups'; diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index 96c7373c16d..852e44bc3e6 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -54,6 +54,14 @@ the date the hold was places foreign key from the biblio table defining which bib record this hold is on +=head2 item_group_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +foreign key from the item_groups table defining if this is an item group level hold + =head2 branchcode data_type: 'varchar' @@ -226,6 +234,8 @@ __PACKAGE__->add_columns( { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "biblionumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "item_group_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "branchcode", { data_type => "varchar", is_nullable => 1, size => 10 }, "desk_id", @@ -336,6 +346,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 item_group + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "item_group", + "Koha::Schema::Result::ItemGroup", + { item_group_id => "item_group_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "SET NULL", + }, +); + =head2 itemnumber Type: belongs_to @@ -377,8 +407,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:08:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A3iHpf4nDeIpPsapNzdv8w +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-28 18:11:37 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SzRPtAXBNm8VnBqkljxfQw __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index c280e277592..a25c3e44fa9 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/Koha/Schema/Result/Reserve.pm @@ -57,6 +57,14 @@ the date the hold was placed foreign key from the biblio table defining which bib record this hold is on +=head2 item_group_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +foreign key from the item_groups table defining if this is an item group level hold + =head2 branchcode data_type: 'varchar' @@ -235,6 +243,8 @@ __PACKAGE__->add_columns( is_foreign_key => 1, is_nullable => 0, }, + "item_group_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "branchcode", { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, "desk_id", @@ -385,6 +395,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 item_group + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "item_group", + "Koha::Schema::Result::ItemGroup", + { item_group_id => "item_group_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 itemnumber Type: belongs_to @@ -426,8 +456,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-22 17:37:42 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kYRPPeoVo0WMk1gH+qmi/w +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-28 18:11:37 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1lqj6ZevsRVDjquZl5YabQ __PACKAGE__->belongs_to( "item", -- 2.30.2