diff --git a/Koha/Schema/Result/HoldGroup.pm b/Koha/Schema/Result/HoldGroup.pm new file mode 100644 index 0000000000..ee15da9c5d --- /dev/null +++ b/Koha/Schema/Result/HoldGroup.pm @@ -0,0 +1,95 @@ +use utf8; +package Koha::Schema::Result::HoldGroup; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::HoldGroup + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("hold_groups"); + +=head1 ACCESSORS + +=head2 hold_group_id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "hold_group_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("hold_group_id"); + +=head1 RELATIONS + +=head2 old_reserves + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "old_reserves", + "Koha::Schema::Result::OldReserve", + { "foreign.hold_group_id" => "self.hold_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.hold_group_id" => "self.hold_group_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-03 17:08:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m3/7K38O11278k5glHlXAA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index 5d90798fcd..028386206d 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -231,6 +231,15 @@ Is the hold placed at item level Is this a non priority hold +=head2 hold_group_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 1 + +The id of a group of titles reservations fulfilled when one title is picked + =cut __PACKAGE__->add_columns( @@ -300,6 +309,13 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "non_priority", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "hold_group_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 1, + }, ); =head1 PRIMARY KEY @@ -376,6 +392,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 hold_group + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "hold_group", + "Koha::Schema::Result::HoldGroup", + { hold_group_id => "hold_group_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "SET NULL", + }, +); + =head2 item_group Type: belongs_to @@ -437,8 +473,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-10-30 17:21:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6huDoFe9Uil1WyJ7EOcQSw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-03 17:08:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bo/exwlpahEVYtkWjusWLw __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index b37465467d..3e65b00f67 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/Koha/Schema/Result/Reserve.pm @@ -229,6 +229,15 @@ Is the hold placed at item level Is this a non priority hold +=head2 hold_group_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 1 + +The id of a group of titles reservations fulfilled when one title is picked + =cut __PACKAGE__->add_columns( @@ -308,6 +317,13 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "non_priority", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "hold_group_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 1, + }, ); =head1 PRIMARY KEY @@ -404,6 +420,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 hold_group + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "hold_group", + "Koha::Schema::Result::HoldGroup", + { hold_group_id => "hold_group_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 item_group Type: belongs_to @@ -465,8 +501,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-10-30 17:21:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bmt1FkgXdJSOMQFdAHO3cQ +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-03 17:08:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:57Fw53HngTXhDU7kVEjqYw __PACKAGE__->belongs_to( "item",