From 40d343ee15f9a09e5e252d7b6c828b99bb36b030 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 26 Jul 2023 14:46:54 -0300 Subject: [PATCH] Bug 28966: DBIC schema Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Item.pm | 12 +++++------ Koha/Schema/Result/TmpHoldsqueue.pm | 31 ++++++++++++++++++----------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index 980ea046c4..ab5f09418b 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -927,24 +927,24 @@ __PACKAGE__->might_have( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 tmp_holdsqueues +=head2 tmp_holdsqueue -Type: has_many +Type: might_have Related object: L =cut -__PACKAGE__->has_many( - "tmp_holdsqueues", +__PACKAGE__->might_have( + "tmp_holdsqueue", "Koha::Schema::Result::TmpHoldsqueue", { "foreign.itemnumber" => "self.itemnumber" }, { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-12 18:18:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HMU2tnuIRypuatz/J5683A +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-26 17:44:52 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FHB+BvL4it4HrzlfNCxoKw __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); diff --git a/Koha/Schema/Result/TmpHoldsqueue.pm b/Koha/Schema/Result/TmpHoldsqueue.pm index 2bf9ec46be..7198134ede 100644 --- a/Koha/Schema/Result/TmpHoldsqueue.pm +++ b/Koha/Schema/Result/TmpHoldsqueue.pm @@ -33,7 +33,7 @@ __PACKAGE__->table("tmp_holdsqueue"); data_type: 'integer' is_foreign_key: 1 - is_nullable: 1 + is_nullable: 0 =head2 barcode @@ -123,7 +123,7 @@ __PACKAGE__->add_columns( "biblionumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "itemnumber", - { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "barcode", { data_type => "varchar", is_nullable => 1, size => 20 }, "surname", @@ -159,6 +159,18 @@ __PACKAGE__->add_columns( }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("itemnumber"); + =head1 RELATIONS =head2 biblionumber @@ -208,17 +220,12 @@ __PACKAGE__->belongs_to( "itemnumber", "Koha::Schema::Result::Item", { itemnumber => "itemnumber" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", - }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-04 22:42:42 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RdIrLi+vbzj3ab/UP7e9pw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-26 17:44:52 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5vbBn2tKY/nPx5aA4gaEtg __PACKAGE__->add_columns( '+item_level_request' => { is_boolean => 1 } @@ -273,11 +280,11 @@ __PACKAGE__->belongs_to( ); sub koha_object_class { - 'Koha::HoldsQueueItem'; + 'Koha::Hold::HoldsQueueItem'; } sub koha_objects_class { - 'Koha::HoldsQueueItems'; + 'Koha::Hold::HoldsQueueItems'; } 1; -- 2.39.5