From c6ddabdc66c91097dbfde2fb0a87dfc3b2f43c3f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 3 May 2016 15:35:51 -0300 Subject: [PATCH] DBIx updates Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- Koha/Schema/Result/Biblio.pm | 19 +++++++++++++++++-- Koha/Schema/Result/Item.pm | 27 ++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index 54f672742f..84aae6105a 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -197,6 +197,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 items + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "items", + "Koha::Schema::Result::Item", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 old_reserves Type: has_many @@ -303,7 +318,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-07-08 15:06:22 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vh7DAGajJCEzHE7YmAG3jg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-05-03 18:29:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NK+HRwn4BhRKwuIfuFqHpA 1; diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index 9b38812fa8..ba49ded3a9 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -33,6 +33,7 @@ __PACKAGE__->table("items"); data_type: 'integer' default_value: 0 + is_foreign_key: 1 is_nullable: 0 =head2 biblioitemnumber @@ -285,7 +286,12 @@ __PACKAGE__->add_columns( "itemnumber", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "biblionumber", - { data_type => "integer", default_value => 0, is_nullable => 0 }, + { + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, + }, "biblioitemnumber", { data_type => "integer", @@ -448,6 +454,21 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 biblionumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "biblionumber", + "Koha::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + =head2 branchtransfers Type: has_many @@ -639,8 +660,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-03-31 17:10:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f3uSqG4SRK96xnD8HnhcFA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-05-03 18:29:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2XK/xYWHqauPzYKJcKc0ig __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); -- 2.39.5