From 124b14d8cd719f284ff215ed8acd81ccb27ed9dc Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 16 May 2016 10:37:42 +0200 Subject: [PATCH] Bug 16170: Update schema Signed-off-by: Julian Maurice --- 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..614a3621a9 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-16 10:36:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A2HfcEZt1mfHFEIa4PM+pg 1; diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index 0fda92eddd..420db724f1 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 @@ -279,7 +280,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", @@ -440,6 +446,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 @@ -616,8 +637,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-11-04 12:00:58 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jkgJfulDrGaUpQ6jC40vpQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-05-16 10:36:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fA9/ZhwGEnOpdWhp56wGGw __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); -- 2.11.4.GIT