@@ -, +, @@ --- 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(-) --- a/Koha/Schema/Result/Biblio.pm +++ a/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( --- a/Koha/Schema/Result/Item.pm +++ a/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" ); --- a/Koha/Schema/Result/Volume.pm +++ a/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'; --- a/Koha/Schema/Result/VolumeItem.pm +++ a/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'; --