From bc1d95f73defaa0f00aed63b84966bdde52a2428 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Nov 2023 14:36:48 +0100 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 075cdba39ab..6a280ad755e 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-09-06 17:56:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aaj6mc1M13YFx5P0aXMiEQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-11-15 13:36:26 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:b+WBMefz8E4uq4+ARW65zw __PACKAGE__->belongs_to( "basket", diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm index ff65a54d955..77ae20fc451 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-11-15 13:36:27 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:b3JQ+hj35nNLpDYC1Fh0kw __PACKAGE__->belongs_to( "suggester", -- 2.34.1