From d34c150e04d5aa91e9da27913e359bf29f536055 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 25 Mar 2020 13:59:43 -0400 Subject: [PATCH] Bug 24860: Update existing Schema files [DO NOT PUSH] Signed-off-by: Andrew Fuerste-Henry --- 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 85e604d288..8e19252d62 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-03-25 17:26:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hOQW/9nUtYONepwVA5At7A sub koha_object_class { 'Koha::Old::Hold'; diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index c5460e34da..72e6309d25 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-03-25 17:26:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ON4vsC/m5XAuZRyhwaILfg __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Volume.pm b/Koha/Schema/Result/Volume.pm index 4551df3fdd..6444b39410 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-03-24 19:00:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9GITIIWcoQQZqxR09g7NRA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-25 17:26:16 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mZvtYuy7RQ4GnakdjMnQ2A sub koha_objects_class { 'Koha::Biblio::Volumes'; -- 2.11.0