From 9e75de1dd41f2f54c4d08897d9ee6acd8fdbc823 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Tue, 22 Dec 2020 07:26:17 +0000 Subject: [PATCH] Bug 15516: DO NOT PUSH - Schema changes Signed-off-by: Michal Denar --- Koha/Schema/Result/HoldGroup.pm | 95 ++++++++++++++++++++++++++++++++++++++++ Koha/Schema/Result/OldReserve.pm | 38 +++++++++++++++- Koha/Schema/Result/Reserve.pm | 38 +++++++++++++++- 3 files changed, 167 insertions(+), 4 deletions(-) create mode 100644 Koha/Schema/Result/HoldGroup.pm diff --git a/Koha/Schema/Result/HoldGroup.pm b/Koha/Schema/Result/HoldGroup.pm new file mode 100644 index 0000000000..2e31a5f296 --- /dev/null +++ b/Koha/Schema/Result/HoldGroup.pm @@ -0,0 +1,95 @@ +use utf8; +package Koha::Schema::Result::HoldGroup; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::HoldGroup + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("hold_group"); + +=head1 ACCESSORS + +=head2 hold_group_id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "hold_group_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("hold_group_id"); + +=head1 RELATIONS + +=head2 old_reserves + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "old_reserves", + "Koha::Schema::Result::OldReserve", + { "foreign.hold_group_id" => "self.hold_group_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.hold_group_id" => "self.hold_group_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-12-22 07:22:51 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YBS0s5ZgS7w5ksLTjDYdUQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index a65cef0814..bdc3b1d86e 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -161,6 +161,13 @@ __PACKAGE__->table("old_reserves"); default_value: 0 is_nullable: 0 +=head2 hold_group_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -224,6 +231,13 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "non_priority", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "hold_group_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 1, + }, ); =head1 PRIMARY KEY @@ -280,6 +294,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 hold_group + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "hold_group", + "Koha::Schema::Result::HoldGroup", + { hold_group_id => "hold_group_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 itemnumber Type: belongs_to @@ -321,8 +355,8 @@ __PACKAGE__->belongs_to( ); -# 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-12-22 07:22:52 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0i9Q9JEQIpOT+VSbQmytYw __PACKAGE__->belongs_to( "item", diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index 491e200f19..a2cebae262 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/Koha/Schema/Result/Reserve.pm @@ -166,6 +166,13 @@ __PACKAGE__->table("reserves"); default_value: 0 is_nullable: 0 +=head2 hold_group_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -239,6 +246,13 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "non_priority", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "hold_group_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 1, + }, ); =head1 PRIMARY KEY @@ -340,6 +354,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 hold_group + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "hold_group", + "Koha::Schema::Result::HoldGroup", + { hold_group_id => "hold_group_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 itemnumber Type: belongs_to @@ -381,8 +415,8 @@ __PACKAGE__->belongs_to( ); -# 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-12-22 07:22:52 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:93bloHkXtOGZ6gEgW2vCTQ __PACKAGE__->belongs_to( "item", -- 2.11.0