From 314523f9493e544ae79e64789a801c84418674fa Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 9 Feb 2015 15:52:24 -0300 Subject: [PATCH] Bug 13007: DBIC updates Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Aqbudget.pm | 19 +++++++++++++++++-- Koha/Schema/Result/Suggestion.pm | 29 ++++++++++++++++++++++++++--- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/Koha/Schema/Result/Aqbudget.pm b/Koha/Schema/Result/Aqbudget.pm index 72592897cb..fa28dfb91d 100644 --- a/Koha/Schema/Result/Aqbudget.pm +++ b/Koha/Schema/Result/Aqbudget.pm @@ -242,6 +242,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 suggestions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "suggestions", + "Koha::Schema::Result::Suggestion", + { "foreign.budgetid" => "self.budget_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 borrowernumbers Type: many_to_many @@ -253,8 +268,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqbudgetborrowers", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-05 15:20:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:733+8NRE5Ip/30URBcJsbA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-09 15:51:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SZKnWPCMNFUm/TzeBxeDZA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm index d255bb12e6..b3f445b248 100644 --- a/Koha/Schema/Result/Suggestion.pm +++ b/Koha/Schema/Result/Suggestion.pm @@ -165,6 +165,7 @@ __PACKAGE__->table("suggestions"); =head2 budgetid data_type: 'integer' + is_foreign_key: 1 is_nullable: 1 =head2 branchcode @@ -270,7 +271,7 @@ __PACKAGE__->add_columns( "patronreason", { data_type => "text", is_nullable => 1 }, "budgetid", - { data_type => "integer", is_nullable => 1 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "branchcode", { data_type => "varchar", is_nullable => 1, size => 10 }, "collectiontitle", @@ -299,9 +300,31 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("suggestionid"); +=head1 RELATIONS + +=head2 budgetid + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "budgetid", + "Koha::Schema::Result::Aqbudget", + { budget_id => "budgetid" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-18 13:01:05 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tMbXZ1id2ls57UMp5jicFA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-09 15:51:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k7YUEiU7g+VxpMsEuOiizg # You can replace this text with custom content, and it will be preserved on regeneration -- 2.39.5