Bug 8836: Update DBIx
authorTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 6 Nov 2014 18:28:19 +0000 (15:28 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 6 Nov 2014 18:28:19 +0000 (15:28 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Koha/Schema/Result/Branch.pm
Koha/Schema/Result/Collection.pm

index 68a92d9..106123a 100644 (file)
@@ -337,6 +337,21 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 collections
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::Collection>
+
+=cut
+
+__PACKAGE__->has_many(
+  "collections",
+  "Koha::Schema::Result::Collection",
+  { "foreign.colBranchcode" => "self.branchcode" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 course_items
 
 Type: has_many
@@ -498,8 +513,8 @@ Composing rels: L</branchrelations> -> categorycode
 __PACKAGE__->many_to_many("categorycodes", "branchrelations", "categorycode");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-27 10:44:50
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WRCu1ThkQVx+o7/ECe0j2A
+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-11-06 15:26:36
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CGNPB/MkGLOihDThj43/4A
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration
index 4f435de..38353ea 100644 (file)
@@ -48,10 +48,9 @@ __PACKAGE__->table("collections");
 
   accessor: 'col_branchcode'
   data_type: 'varchar'
+  is_foreign_key: 1
   is_nullable: 1
-  size: 4
-
-branchcode for branch where item should be held.
+  size: 10
 
 =cut
 
@@ -77,8 +76,9 @@ __PACKAGE__->add_columns(
   {
     accessor => "col_branchcode",
     data_type => "varchar",
+    is_foreign_key => 1,
     is_nullable => 1,
-    size => 4,
+    size => 10,
   },
 );
 
@@ -94,9 +94,31 @@ __PACKAGE__->add_columns(
 
 __PACKAGE__->set_primary_key("colId");
 
+=head1 RELATIONS
+
+=head2 col_branchcode
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Branch>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "col_branchcode",
+  "Koha::Schema::Result::Branch",
+  { branchcode => "colBranchcode" },
+  {
+    is_deferrable => 1,
+    join_type     => "LEFT",
+    on_delete     => "CASCADE",
+    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:4QFGZYwbv0aj6eXdn7vO9A
+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-11-06 15:26:36
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gb7EYny5ULsZw8rYQQ/hjA
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration