From a008ad788c9a551c689ea616ac6191e409098284 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 6 Nov 2020 12:01:11 +0100 Subject: [PATCH] Bug 24412: DBIC schema changes Signed-off-by: Jonathan Druart --- Koha/Schema/Result/Desk.pm | 19 +++++++++++++++++-- Koha/Schema/Result/OldReserve.pm | 11 +++++++++-- Koha/Schema/Result/Reserve.pm | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/Koha/Schema/Result/Desk.pm b/Koha/Schema/Result/Desk.pm index a72be1b21f..9201a9315e 100644 --- a/Koha/Schema/Result/Desk.pm +++ b/Koha/Schema/Result/Desk.pm @@ -83,9 +83,24 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 reserves -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2019-10-02 13:43:57 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IklOycKlChqv9Tftm8rjqA +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "reserves", + "Koha::Schema::Result::Reserve", + { "foreign.desk_id" => "self.desk_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-11-06 11:00:40 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Weoxj3CBeajLEzx9DBX1ag # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index 2cc0e2f425..eae6d24d3b 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -52,6 +52,11 @@ __PACKAGE__->table("old_reserves"); is_nullable: 1 size: 10 +=head2 desk_id + + data_type: 'integer' + is_nullable: 1 + =head2 notificationdate data_type: 'date' @@ -169,6 +174,8 @@ __PACKAGE__->add_columns( { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "branchcode", { data_type => "varchar", is_nullable => 1, size => 10 }, + "desk_id", + { data_type => "integer", is_nullable => 1 }, "notificationdate", { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "reminderdate", @@ -314,8 +321,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-08-31 14:16:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DnOerXRIsIGIRKl9I0HZUQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-11-06 11:00:40 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7weIpuc0RpZ/MxFn94E8dg __PACKAGE__->add_columns( '+item_level_hold' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Reserve.pm b/Koha/Schema/Result/Reserve.pm index 2d7b397ec3..8db8cecd36 100644 --- a/Koha/Schema/Result/Reserve.pm +++ b/Koha/Schema/Result/Reserve.pm @@ -56,6 +56,12 @@ __PACKAGE__->table("reserves"); is_nullable: 1 size: 10 +=head2 desk_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + =head2 notificationdate data_type: 'date' @@ -183,6 +189,8 @@ __PACKAGE__->add_columns( }, "branchcode", { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, + "desk_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "notificationdate", { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "reminderdate", @@ -312,6 +320,26 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 desk + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "desk", + "Koha::Schema::Result::Desk", + { desk_id => "desk_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 itemnumber Type: belongs_to @@ -353,8 +381,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-08-31 14:16:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:goRy3ZQWpGNmicok5Av37Q +# 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 __PACKAGE__->belongs_to( "item", -- 2.39.5