From 3cab4d1efd25268441c88ce74d5a4b568773c8aa Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 4 Nov 2015 12:09:06 -0300 Subject: [PATCH] Bug 14978: (RM followup) DBIx update Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Issue.pm | 18 ++++++++++++++++-- Koha/Schema/Result/Item.pm | 12 ++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm index 0a0eb17124..0144a86a63 100644 --- a/Koha/Schema/Result/Issue.pm +++ b/Koha/Schema/Result/Issue.pm @@ -165,6 +165,20 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("issue_id"); +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("itemnumber", ["itemnumber"]); + =head1 RELATIONS =head2 borrowernumber @@ -208,8 +222,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-04-23 13:04:51 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3JH0+3CuwwhPyebyt/z+uw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-11-04 12:00:58 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kREecsHr6wZPiokS946BHw __PACKAGE__->belongs_to( "borrower", diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index c342f46adb..08031b2c31 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -540,16 +540,16 @@ __PACKAGE__->belongs_to( }, ); -=head2 issues +=head2 issue -Type: has_many +Type: might_have Related object: L =cut -__PACKAGE__->has_many( - "issues", +__PACKAGE__->might_have( + "issue", "Koha::Schema::Result::Issue", { "foreign.itemnumber" => "self.itemnumber" }, { cascade_copy => 0, cascade_delete => 0 }, @@ -616,8 +616,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-04-23 12:42:12 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:urSpNt7LBda4T5Plhi6cPw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-11-04 12:00:58 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jkgJfulDrGaUpQ6jC40vpQ sub effective_itemtype { my ( $self ) = @_; -- 2.39.5