From 3d4347decbc1be47ecf2d8f490a114a146718f3c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 6 Jul 2020 10:35:35 -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 3df98cc4e5..ed12e5f10e 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' @@ -155,6 +161,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", @@ -297,9 +305,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 @ 2020-03-18 12:43:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4vMUC/1kSr3vgQ7n0Pmuug +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-07-06 14:34:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:a4H7IwYqW3wiHFRIQNeeLA __PACKAGE__->add_columns( '+item_level_hold' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index c5460e34da..4d7bfeec9d 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' @@ -169,6 +175,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", @@ -336,9 +344,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 @ 2020-03-18 12:43:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VH7h5kYo9WhlGobXb3N3Jg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-07-06 14:34:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wWf5CudObnwQ7gAnWbDt2g __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Volume.pm b/Koha/Schema/Result/Volume.pm index d7a4a35824..1c4d4a03f8 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-07-06 14:34:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:map/X+OyjZAhJzs/j31+lQ sub koha_objects_class { 'Koha::Biblio::Volumes'; -- 2.24.1 (Apple Git-126)