From d03e7885e1462a54035fbf7d821199267c9093c1 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 16 Sep 2025 13:46:29 +0100 Subject: [PATCH] Bug 40817: Schema updates Signed-off-by: Jackie Usher --- Koha/Schema/Result/Accountline.pm | 60 +++++++++++++++++++++++++++++-- Koha/Schema/Result/OldReserve.pm | 26 ++++++++++++-- Koha/Schema/Result/Reserve.pm | 22 ++++++++++++ 3 files changed, 104 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm index e1fc5c20579..cb0a282af07 100644 --- a/Koha/Schema/Result/Accountline.pm +++ b/Koha/Schema/Result/Accountline.pm @@ -41,6 +41,18 @@ __PACKAGE__->table("accountlines"); is_foreign_key: 1 is_nullable: 1 +=head2 reserve_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 old_reserve_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + =head2 borrowernumber data_type: 'integer' @@ -160,6 +172,10 @@ __PACKAGE__->add_columns( { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "old_issue_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "reserve_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "old_reserve_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "borrowernumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "itemnumber", @@ -424,6 +440,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 old_reserve + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "old_reserve", + "Koha::Schema::Result::OldReserve", + { reserve_id => "old_reserve_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 register Type: belongs_to @@ -444,9 +480,29 @@ __PACKAGE__->belongs_to( }, ); +=head2 reserve + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "reserve", + "Koha::Schema::Result::Reserve", + { reserve_id => "reserve_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-02-08 14:18:03 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aVLdvK1lek01lZ0mbaCwZQ +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-16 10:19:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JGNBdISXLLAdEXI25nrzaQ =head2 patron diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index 028386206dc..e3bd4e62183 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -332,6 +332,21 @@ __PACKAGE__->set_primary_key("reserve_id"); =head1 RELATIONS +=head2 accountlines + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "accountlines", + "Koha::Schema::Result::Accountline", + { "foreign.old_reserve_id" => "self.reserve_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 biblionumber Type: belongs_to @@ -473,8 +488,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:bo/exwlpahEVYtkWjusWLw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-16 10:19:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RLh8fPWOVtWzG3VGOXyz6Q __PACKAGE__->belongs_to( "item", @@ -551,4 +566,11 @@ sub koha_objects_class { 'Koha::Old::Holds'; } +__PACKAGE__->has_many( + "accountlines", + "Koha::Schema::Result::Accountline", + { "foreign.old_reserve_id" => "self.reserve_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + 1; diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index 749a672c8d9..a5f22f09fb3 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/Koha/Schema/Result/Reserve.pm @@ -340,6 +340,21 @@ __PACKAGE__->set_primary_key("reserve_id"); =head1 RELATIONS +=head2 accountlines + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "accountlines", + "Koha::Schema::Result::Accountline", + { "foreign.reserve_id" => "self.reserve_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 biblionumber Type: belongs_to @@ -603,4 +618,11 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +__PACKAGE__->has_many( + "accountlines", + "Koha::Schema::Result::Accountline", + { "foreign.reserve_id" => "self.reserve_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + 1; -- 2.51.1