Bugzilla – Attachment 188356 Details for
Bug 40529
Update how hold groups work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40529: [DONT PUSH] dbic
Bug-40529-DONT-PUSH-dbic.patch (text/plain), 5.04 KB, created by
Pedro Amorim
on 2025-10-23 13:03:46 UTC
(
hide
)
Description:
Bug 40529: [DONT PUSH] dbic
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-23 13:03:46 UTC
Size:
5.04 KB
patch
obsolete
>From 749cc43365a49f8792ac0641fda7f758a3aa9eac Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 23 Oct 2025 13:02:14 +0000 >Subject: [PATCH] Bug 40529: [DONT PUSH] dbic > >--- > Koha/Schema/Result/HoldGroup.pm | 19 ++- > Koha/Schema/Result/HoldGroupTargetHold.pm | 135 ++++++++++++++++++++++ > Koha/Schema/Result/Reserve.pm | 19 ++- > 3 files changed, 169 insertions(+), 4 deletions(-) > create mode 100644 Koha/Schema/Result/HoldGroupTargetHold.pm > >diff --git a/Koha/Schema/Result/HoldGroup.pm b/Koha/Schema/Result/HoldGroup.pm >index 7977cd45c03..2e8e6bcac67 100644 >--- a/Koha/Schema/Result/HoldGroup.pm >+++ b/Koha/Schema/Result/HoldGroup.pm >@@ -95,6 +95,21 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 hold_group_target_hold >+ >+Type: might_have >+ >+Related object: L<Koha::Schema::Result::HoldGroupTargetHold> >+ >+=cut >+ >+__PACKAGE__->might_have( >+ "hold_group_target_hold", >+ "Koha::Schema::Result::HoldGroupTargetHold", >+ { "foreign.hold_group_id" => "self.hold_group_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 old_reserves > > Type: has_many >@@ -126,8 +141,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-10-16 08:38:47 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K942uOr52EEdt/f3Sm6i5Q >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-10-23 13:01:15 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nck+/QslyOmG+mRDGtzd6w > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/HoldGroupTargetHold.pm b/Koha/Schema/Result/HoldGroupTargetHold.pm >new file mode 100644 >index 00000000000..1a919e4a4ff >--- /dev/null >+++ b/Koha/Schema/Result/HoldGroupTargetHold.pm >@@ -0,0 +1,135 @@ >+use utf8; >+package Koha::Schema::Result::HoldGroupTargetHold; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::HoldGroupTargetHold >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<hold_group_target_holds> >+ >+=cut >+ >+__PACKAGE__->table("hold_group_target_holds"); >+ >+=head1 ACCESSORS >+ >+=head2 hold_group_id >+ >+ data_type: 'integer' >+ extra: {unsigned => 1} >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+foreign key, linking this to the hold_groups table >+ >+=head2 reserve_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+foreign key, linking this to the reserves table >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "hold_group_id", >+ { >+ data_type => "integer", >+ extra => { unsigned => 1 }, >+ is_foreign_key => 1, >+ is_nullable => 0, >+ }, >+ "reserve_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</hold_group_id> >+ >+=item * L</reserve_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("hold_group_id", "reserve_id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<hold_group_id> >+ >+=over 4 >+ >+=item * L</hold_group_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("hold_group_id", ["hold_group_id"]); >+ >+=head2 C<reserve_id> >+ >+=over 4 >+ >+=item * L</reserve_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("reserve_id", ["reserve_id"]); >+ >+=head1 RELATIONS >+ >+=head2 hold_group >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::HoldGroup> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "hold_group", >+ "Koha::Schema::Result::HoldGroup", >+ { hold_group_id => "hold_group_id" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, >+); >+ >+=head2 reserve >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Reserve> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "reserve", >+ "Koha::Schema::Result::Reserve", >+ { reserve_id => "reserve_id" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-10-23 13:01:15 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NtAC7d08ku24na/QpXzS1g >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm >index 3e65b00f67c..78608cc6a7a 100644 >--- a/Koha/Schema/Result/Reserve.pm >+++ b/Koha/Schema/Result/Reserve.pm >@@ -440,6 +440,21 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 hold_group_target_hold >+ >+Type: might_have >+ >+Related object: L<Koha::Schema::Result::HoldGroupTargetHold> >+ >+=cut >+ >+__PACKAGE__->might_have( >+ "hold_group_target_hold", >+ "Koha::Schema::Result::HoldGroupTargetHold", >+ { "foreign.reserve_id" => "self.reserve_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 item_group > > Type: belongs_to >@@ -501,8 +516,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-03 17:08:22 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:57Fw53HngTXhDU7kVEjqYw >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-10-23 13:01:15 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gThGGm5pjnkd2qyr8GWdCw > > __PACKAGE__->belongs_to( > "item", >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40529
:
184868
|
184869
|
184870
|
184871
|
184872
|
185137
|
185138
|
185139
|
185140
|
185141
|
185210
|
185211
|
185212
|
185213
|
185214
|
185215
|
185303
|
185304
|
185305
|
185306
|
185307
|
186793
|
186794
|
186795
|
186796
|
186797
|
186798
|
186803
|
186804
|
186825
|
186826
|
186827
|
186828
|
186829
|
186830
|
186831
|
186832
|
188348
|
188349
|
188350
|
188351
|
188352
|
188353
|
188354
|
188355
| 188356 |
188594
|
188595
|
188933
|
188934