@@ -, +, @@ --- Koha/Schema/Result/OldReserve.pm | 32 +++++++++++++++++++-- Koha/Schema/Result/Reserve.pm | 32 +++++++++++++++++++-- Koha/Schema/Result/Volume.pm | 48 ++++++++++++++++++++++++++++---- Koha/Schema/Result/VolumeItem.pm | 20 +++++++++++-- 4 files changed, 120 insertions(+), 12 deletions(-) --- a/Koha/Schema/Result/OldReserve.pm +++ a/Koha/Schema/Result/OldReserve.pm @@ -46,6 +46,12 @@ __PACKAGE__->table("old_reserves"); is_foreign_key: 1 is_nullable: 1 +=head2 volume_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + =head2 branchcode data_type: 'varchar' @@ -154,6 +160,8 @@ __PACKAGE__->add_columns( { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "biblionumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "volume_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "branchcode", { data_type => "varchar", is_nullable => 1, size => 10 }, "notificationdate", @@ -296,9 +304,29 @@ __PACKAGE__->belongs_to( }, ); +=head2 volume + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "volume", + "Koha::Schema::Result::Volume", + { id => "volume_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "SET NULL", + }, +); + -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 07:24:39 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZgGAW7ODBby3hGNJ41eeMA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-28 13:18:28 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/m1/cy2asQAQbNqcb/45Ug sub koha_object_class { 'Koha::Old::Hold'; --- a/Koha/Schema/Result/Reserve.pm +++ a/Koha/Schema/Result/Reserve.pm @@ -49,6 +49,12 @@ __PACKAGE__->table("reserves"); is_foreign_key: 1 is_nullable: 0 +=head2 volume_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + =head2 branchcode data_type: 'varchar' @@ -168,6 +174,8 @@ __PACKAGE__->add_columns( is_foreign_key => 1, is_nullable => 0, }, + "volume_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "branchcode", { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, "notificationdate", @@ -335,9 +343,29 @@ __PACKAGE__->belongs_to( }, ); +=head2 volume + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "volume", + "Koha::Schema::Result::Volume", + { id => "volume_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Pc5zh5iFbdwko5KS51Y9Uw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-24 11:26:50 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZH4g79tek2appBHwdFLn5g __PACKAGE__->belongs_to( "item", --- 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", { @@ -114,6 +120,36 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 old_reserves + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "old_reserves", + "Koha::Schema::Result::OldReserve", + { "foreign.volume_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 reserves + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "reserves", + "Koha::Schema::Result::Reserve", + { "foreign.volume_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 volume_items Type: has_many @@ -130,8 +166,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-02-28 14:28:24 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Qg1AhIgW7n2Ws8rAwdFSpw 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-02-24 11:26:50 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kKgCjlgDCv3FgqYffaAyng sub koha_object_class { 'Koha::Biblio::Volume::Item'; --