From 5fcf91258489f70d2dc8f1b5d8dff93af5f3582f Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 26 Feb 2019 05:07:17 +0000 Subject: [PATCH] Bug 13515: Schema Updates Signed-off-by: Lucas Gass --- Koha/Schema/Result/Borrower.pm | 19 +++++++++++++++++-- Koha/Schema/Result/Branch.pm | 4 ++-- Koha/Schema/Result/Message.pm | 22 +++++++++++++++++++--- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 68f7da6a22..c142189dd9 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1100,6 +1100,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 messages_borrowernumbers + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "messages_borrowernumbers", + "Koha::Schema::Result::Message", + { "foreign.borrowernumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 old_issues Type: has_many @@ -1401,8 +1416,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-04-11 19:53:27 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/vLIMxDv4RcJOqKj6Mfg6w +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-02-26 02:08:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KC4GFFMOANSZtSOtnvAQbQ __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index ea010acafe..78f834e912 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -624,8 +624,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-09 10:38:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nKWRDScCAwZUDrRhm1kYMA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-02-26 04:54:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0ZO0+AUGM6NukYvWQZGMyA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Message.pm b/Koha/Schema/Result/Message.pm index 9fd862eee6..c2bd71b4c5 100644 --- a/Koha/Schema/Result/Message.pm +++ b/Koha/Schema/Result/Message.pm @@ -32,6 +32,7 @@ __PACKAGE__->table("messages"); =head2 borrowernumber data_type: 'integer' + is_foreign_key: 1 is_nullable: 0 =head2 branchcode @@ -70,7 +71,7 @@ __PACKAGE__->add_columns( "message_id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "borrowernumber", - { data_type => "integer", is_nullable => 0 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "branchcode", { data_type => "varchar", is_nullable => 1, size => 10 }, "message_type", @@ -102,6 +103,21 @@ __PACKAGE__->set_primary_key("message_id"); =head1 RELATIONS +=head2 borrowernumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "borrowernumber", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + =head2 manager Type: belongs_to @@ -123,8 +139,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cNf9ogl9bN+0BC63dS1rmA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-02-26 04:54:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KYxtiT2xJOGu3HMkcX7Pnw # You can replace this text with custom content, and it will be preserved on regeneration -- 2.39.5