From 72fb8c76aabe15131f345c3eb08385f79938da62 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 13 Nov 2020 12:17:10 -0500 Subject: [PATCH] Bug 24860: Update existing Schema files [DO NOT PUSH] --- Koha/Schema/Result/OldReserve.pm | 32 ++++++++++++++++++++++++++++-- Koha/Schema/Result/Reserve.pm | 32 ++++++++++++++++++++++++++++-- Koha/Schema/Result/Volume.pm | 34 ++++++++++++++++++++++++++++++-- 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index a65cef0814..58169d16c5 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/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' @@ -172,6 +178,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 }, "desk_id", @@ -320,9 +328,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.07049 @ 2020-11-06 11:00:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7weIpuc0RpZ/MxFn94E8dg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-11-13 16:19:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QsAkhw9ZKahdMfjpwqlyGQ __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index 491e200f19..d333795d07 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/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' @@ -187,6 +193,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 }, "desk_id", @@ -380,9 +388,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.07049 @ 2020-11-06 11:00:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ue2kNBP+lq8+9NthPiYrrw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-11-13 16:19:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SUom0h/p3wqI/CcscMAHbw __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Volume.pm b/Koha/Schema/Result/Volume.pm index e532e89e7a..b8c69a80b9 100644 --- a/Koha/Schema/Result/Volume.pm +++ b/Koha/Schema/Result/Volume.pm @@ -120,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 @@ -136,8 +166,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-11-05 18:59:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YKcsboHxWfAQgUIRZEivAQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-11-13 16:19:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ixn+Qdy/w6VuEgTJjjWklQ =head2 koha_objects_class -- 2.24.1 (Apple Git-126)