From fe85f9d257a353c1abb6e6b227fce94dad8c1e93 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 10 Nov 2022 14:44:59 -0300 Subject: [PATCH] Bug 24606: DBIC schema Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Borrower.pm | 19 +++++++++++++++++-- Koha/Schema/Result/ItemEditorTemplate.pm | 14 +++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 60684eebd8..f32bb51afd 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1462,6 +1462,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 item_editor_templates + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "item_editor_templates", + "Koha::Schema::Result::ItemEditorTemplate", + { "foreign.patron_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 items_last_borrowers Type: has_many @@ -2043,8 +2058,8 @@ Composing rels: L -> permission __PACKAGE__->many_to_many("permissions", "user_permissions", "permission"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aezs6MyXhwra3gEHhXjAmg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-10 17:43:30 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5hh2lGCcKclyTnY7KNPkvg __PACKAGE__->has_many( "extended_attributes", diff --git a/Koha/Schema/Result/ItemEditorTemplate.pm b/Koha/Schema/Result/ItemEditorTemplate.pm index 0f34cebf1d..eda8b5bc0a 100644 --- a/Koha/Schema/Result/ItemEditorTemplate.pm +++ b/Koha/Schema/Result/ItemEditorTemplate.pm @@ -31,7 +31,7 @@ __PACKAGE__->table("item_editor_templates"); id for the template -=head2 borrowernumber +=head2 patron_id data_type: 'integer' is_foreign_key: 1 @@ -66,7 +66,7 @@ json encoded template data __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, - "borrowernumber", + "patron_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "name", { data_type => "mediumtext", is_nullable => 0 }, @@ -90,7 +90,7 @@ __PACKAGE__->set_primary_key("id"); =head1 RELATIONS -=head2 borrowernumber +=head2 patron Type: belongs_to @@ -99,9 +99,9 @@ Related object: L =cut __PACKAGE__->belongs_to( - "borrowernumber", + "patron", "Koha::Schema::Result::Borrower", - { borrowernumber => "borrowernumber" }, + { borrowernumber => "patron_id" }, { is_deferrable => 1, join_type => "LEFT", @@ -111,8 +111,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-28 16:49:35 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7JIe4z78F9oMOAnAZdqmtA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-10 17:43:30 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9W+tUIeeQnoitoQZ6d0wQg __PACKAGE__->add_columns( '+is_shared' => { is_boolean => 1 }, -- 2.39.5