From 6001765ba16c5d2f36847254fc8a278023d52022 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 31 Oct 2016 10:41:40 +0000 Subject: [PATCH] Bug 17397 - Update Schema Files Signed-off-by: Kyle M Hall --- Koha/Schema/Result/Borrower.pm | 19 +++++++++++++++++-- Koha/Schema/Result/Message.pm | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 89c33a0592..1fe3988360 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1018,6 +1018,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 messages + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "messages", + "Koha::Schema::Result::Message", + { "foreign.manager_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 old_issues Type: has_many @@ -1319,8 +1334,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-24 13:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3x6ma9Zw8B5BOg89weoy8g +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-31 10:39:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Lc6GQ2E7d+tyzTk3v2sWjQ __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/Message.pm b/Koha/Schema/Result/Message.pm index d596cb477f..085cb69590 100644 --- a/Koha/Schema/Result/Message.pm +++ b/Koha/Schema/Result/Message.pm @@ -58,6 +58,12 @@ __PACKAGE__->table("messages"); default_value: current_timestamp is_nullable: 0 +=head2 manager_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -78,6 +84,8 @@ __PACKAGE__->add_columns( default_value => \"current_timestamp", is_nullable => 0, }, + "manager_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -92,9 +100,31 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("message_id"); +=head1 RELATIONS + +=head2 manager + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "manager", + "Koha::Schema::Result::Borrower", + { borrowernumber => "manager_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); + -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iq+Uo9eMnkDgUQsRR6VFUA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-31 10:39:36 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Lmkl/u8Lr1cQumfZvn5D4A # You can replace this text with custom content, and it will be preserved on regeneration -- 2.39.5