From 3280ba5879894adc1f2d20f6260112c870671b65 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 25 Aug 2020 10:48:12 -0400 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 5843c090c3..1dc6f0b411 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' @@ -161,6 +167,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", @@ -305,9 +313,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-08-25 13:08:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PtDLEieaxS+76FD0H943Zg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-25 14:45:34 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mKbtcdxSEzY3eetqVB9ZaA __PACKAGE__->add_columns( '+item_level_hold' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index c56d6e15c2..b1857dfd55 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' @@ -175,6 +181,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", @@ -344,9 +352,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-08-25 13:08:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qdEIwB+DOrraRb+zd4F6yQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-25 14:45:34 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UlQ6kiK+mfL/ZTJ+i371VA __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Volume.pm b/Koha/Schema/Result/Volume.pm index 2c4417288f..d5326b0b1b 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-05-15 17:43:22 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0synkJlBPpaIOLrX2KUKiA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-25 14:45:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:34YkcGxJoy/fSZRmmLUFzQ =head2 koha_objects_class -- 2.24.1 (Apple Git-126)