From e78b55bf14ffcd8f06312b66a8fc33945d7a02dd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 10 May 2023 14:51:26 +0200 Subject: [PATCH] Bug 28844: DBIC schema changes --- Koha/Schema/Result/Aqorder.pm | 34 ++++++++++++++++++++++++++++++-- Koha/Schema/Result/Suggestion.pm | 19 ++++++++++++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm index 03df029945a..7a9e91ed823 100644 --- a/Koha/Schema/Result/Aqorder.pm +++ b/Koha/Schema/Result/Aqorder.pm @@ -366,6 +366,14 @@ was this price uncertain (1 for yes, 0 for no) links this order line to a subscription (subscription.subscriptionid) +=head2 suggestionid + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +links this order line to a suggestion (suggestion.suggestionid) + =head2 parent_ordernumber data_type: 'integer' @@ -534,6 +542,8 @@ __PACKAGE__->add_columns( { data_type => "tinyint", is_nullable => 1 }, "subscriptionid", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "suggestionid", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "parent_ordernumber", { data_type => "integer", is_nullable => 1 }, "orderstatus", @@ -803,6 +813,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 suggestionid + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "suggestionid", + "Koha::Schema::Result::Suggestion", + { suggestionid => "suggestionid" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 borrowernumbers Type: many_to_many @@ -814,8 +844,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-05 12:31:38 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Bt8GMBWcWja5oa7r+8Vbig +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-10 12:49:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QII6LGWS65eIOYsDpSWTqA __PACKAGE__->belongs_to( "basket", diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm index ff65a54d955..0b631b9caf6 100644 --- a/Koha/Schema/Result/Suggestion.pm +++ b/Koha/Schema/Result/Suggestion.pm @@ -416,6 +416,21 @@ __PACKAGE__->belongs_to( }, ); +=head2 aqorders + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "aqorders", + "Koha::Schema::Result::Aqorder", + { "foreign.suggestionid" => "self.suggestionid" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 biblionumber Type: belongs_to @@ -557,8 +572,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 @ 2023-05-10 12:49:30 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Z1aF1it3LooyS8nMMiTrSw __PACKAGE__->belongs_to( "suggester", -- 2.25.1