From 3655544836a18d4bb8cd5c39e2bb4b0dca31269a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 24 Mar 2020 15:00:40 -0400 Subject: [PATCH] Bug 24857: Update existing Schema files [DO NOT PUSH] --- Koha/Schema/Result/Biblio.pm | 19 +++++++++++++++++-- Koha/Schema/Result/Item.pm | 19 +++++++++++++++++-- Koha/Schema/Result/Volume.pm | 18 ++++++++++++------ Koha/Schema/Result/VolumeItem.pm | 20 ++++++++++++++++++-- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index 7c66b1dc03..fccbb7aa08 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -405,9 +405,24 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 volumes -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:otCex8qzJmZyc+JXpKNdpQ +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "volumes", + "Koha::Schema::Result::Volume", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 19:00:02 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wxjOCSKRMo2UiEPA8FYpLQ __PACKAGE__->has_one( diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index 58cddf4502..25e108b4a7 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -745,9 +745,24 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 volume_items -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-17 10:42:24 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CcrMhgq+PQ1MHV6jZEN8wA +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "volume_items", + "Koha::Schema::Result::VolumeItem", + { "foreign.itemnumber" => "self.itemnumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 19:00:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AnHkbPstDoIFODxYR1q98w __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); diff --git a/Koha/Schema/Result/Volume.pm b/Koha/Schema/Result/Volume.pm index 30388d165d..4551df3fdd 100644 --- a/Koha/Schema/Result/Volume.pm +++ b/Koha/Schema/Result/Volume.pm @@ -36,6 +36,12 @@ __PACKAGE__->table("volumes"); is_foreign_key: 1 is_nullable: 0 +=head2 display_order + + data_type: 'integer' + default_value: 0 + is_nullable: 0 + =head2 description data_type: 'mediumtext' @@ -45,8 +51,7 @@ __PACKAGE__->table("volumes"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: '0000-00-00 00:00:00' - is_nullable: 0 + is_nullable: 1 =head2 updated_on @@ -67,14 +72,15 @@ __PACKAGE__->add_columns( is_foreign_key => 1, is_nullable => 0, }, + "display_order", + { data_type => "integer", default_value => 0, is_nullable => 0 }, "description", { data_type => "mediumtext", is_nullable => 1 }, "created_on", { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => "0000-00-00 00:00:00", - is_nullable => 0, + is_nullable => 1, }, "updated_on", { @@ -130,8 +136,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-04 15:22:18 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cXvLM2TgY18pxE2ZJBMouw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 19:00:04 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9GITIIWcoQQZqxR09g7NRA sub koha_objects_class { 'Koha::Biblio::Volumes'; diff --git a/Koha/Schema/Result/VolumeItem.pm b/Koha/Schema/Result/VolumeItem.pm index 3ce549209b..2b535e1a45 100644 --- a/Koha/Schema/Result/VolumeItem.pm +++ b/Koha/Schema/Result/VolumeItem.pm @@ -76,6 +76,22 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("volume_id", ["volume_id", "itemnumber"]); + =head1 RELATIONS =head2 itemnumber @@ -109,8 +125,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-03 18:25:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:i6YHB4Jq+79kVVYmuurzIQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 19:00:04 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:siJ0eMr/qv1wNx3yoINiDA sub koha_object_class { 'Koha::Biblio::Volume::Item'; -- 2.21.1 (Apple Git-122.3)