From 22e3f86ebcf4e3171f8ba0c3400e75a41eca8f56 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 5 Jan 2024 14:27:33 +0000 Subject: [PATCH] Bug 35717: DBIC schema changes --- Koha/Schema/Result/Aqorder.pm | 19 ++++++++++++++++-- Koha/Schema/Result/Suggestion.pm | 34 ++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm index 075cdba39ab..6d14ee2334d 100644 --- a/Koha/Schema/Result/Aqorder.pm +++ b/Koha/Schema/Result/Aqorder.pm @@ -803,6 +803,21 @@ __PACKAGE__->belongs_to( }, ); +=head2 suggestions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "suggestions", + "Koha::Schema::Result::Suggestion", + { "foreign.ordernumber" => "self.ordernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 borrowernumbers Type: many_to_many @@ -814,8 +829,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-09-06 17:56:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aaj6mc1M13YFx5P0aXMiEQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-01-05 14:22:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ym0QsLhqY/xj2BuzZ9Idpg __PACKAGE__->belongs_to( "basket", diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm index ff65a54d955..dc9a69420f1 100644 --- a/Koha/Schema/Result/Suggestion.pm +++ b/Koha/Schema/Result/Suggestion.pm @@ -219,6 +219,14 @@ isbn of the suggested item foreign key linking the suggestion to the biblio table after the suggestion has been ordered +=head2 ordernumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +foreign key linking the suggestion to the acquisitions order after the suggestion has been ordered + =head2 reason data_type: 'mediumtext' @@ -360,6 +368,8 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 30 }, "biblionumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "ordernumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "reason", { data_type => "mediumtext", is_nullable => 1 }, "patronreason", @@ -516,6 +526,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 ordernumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "ordernumber", + "Koha::Schema::Result::Aqorder", + { ordernumber => "ordernumber" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 rejectedby Type: belongs_to @@ -557,8 +587,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-07 20:40:07 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NSX5a0b7SJyhLVT8Fx4jaQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2024-01-05 14:22:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:r/e9P7F0v11ITvFT1qQztQ __PACKAGE__->belongs_to( "suggester", -- 2.30.2