@@ -, +, @@ --- 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(-) --- a/Koha/Schema/Result/ItemGroup.pm +++ a/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-06-02 18:37:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+8B7JDt2YoStGs+3997+Mw sub koha_objects_class { 'Koha::Biblio::ItemGroups'; --- a/Koha/Schema/Result/OldReserve.pm +++ a/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-06-02 18:37:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3OKtvxylXpU9wl6pUKpSSQ __PACKAGE__->belongs_to( "item", --- a/Koha/Schema/Result/Reserve.pm +++ a/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 => 1, size => 10 }, "desk_id", @@ -390,6 +400,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 @@ -431,8 +461,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:7Q8/GFCOkXdn+jg69HZ0GQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-02 18:37:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H5wYFB4A1BoAWPYtJxJntQ __PACKAGE__->belongs_to( "item", --