Bug 17397 - Update Schema Files
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 31 Oct 2016 10:41:40 +0000 (10:41 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 31 Oct 2016 10:41:40 +0000 (10:41 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Schema/Result/Borrower.pm
Koha/Schema/Result/Message.pm

index 89c33a0..1fe3988 100644 (file)
@@ -1018,6 +1018,21 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 messages
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::Message>
+
+=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</aqorder_users> -> 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",
index d596cb4..085cb69 100644 (file)
@@ -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<Koha::Schema::Result::Borrower>
+
+=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