From c96ab7d19dfe0733f924ba6bb4026c62a53e2a75 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 6 Nov 2014 15:28:19 -0300 Subject: [PATCH] Bug 8836: Update DBIx Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Branch.pm | 19 ++++++++++++++++-- Koha/Schema/Result/Collection.pm | 34 ++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 68a92d9311..106123a834 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -337,6 +337,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 collections + +Type: has_many + +Related object: L + +=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 -> 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 diff --git a/Koha/Schema/Result/Collection.pm b/Koha/Schema/Result/Collection.pm index 4f435dec2b..38353ea3dc 100644 --- a/Koha/Schema/Result/Collection.pm +++ b/Koha/Schema/Result/Collection.pm @@ -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 + +=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 -- 2.39.5