From c5fd5aa3acad8a68b398357b10cc6546ae5644de Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 17 Oct 2024 10:11:41 -0300 Subject: [PATCH] Bug 35717: DBIC schema [DO NOT PUSH] --- 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 2adab1a8b48..cacb5d4c136 100644 --- a/Koha/Schema/Result/Aqorder.pm +++ b/Koha/Schema/Result/Aqorder.pm @@ -794,6 +794,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 @@ -805,8 +820,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-04-30 13:34:51 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FyRqcj4OmkBR6PpW3tY8bA +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-10-17 13:11:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hoDBpSPphnZZgVVZB02Obw __PACKAGE__->belongs_to( "basket", diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm index ff65a54d955..e1bf1d39192 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.07051 @ 2024-10-17 13:11:14 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WUh0j1iuWDQ1oiKplb0meg __PACKAGE__->belongs_to( "suggester", -- 2.47.0