Bugzilla – Attachment 133778 Details for
Bug 30449
Missing FK constraint on borrower_attribute_types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30449: DBIC updates
Bug-30449-DBIC-updates.patch (text/plain), 3.27 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-04-25 13:12:47 UTC
(
hide
)
Description:
Bug 30449: DBIC updates
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-04-25 13:12:47 UTC
Size:
3.27 KB
patch
obsolete
>From 49eca48c3dd18ba54592055b0a89cf1ee5ec39a5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 25 Apr 2022 09:51:24 -0300 >Subject: [PATCH] Bug 30449: DBIC updates > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Schema/Result/BorrowerAttributeType.pm | 27 ++++++++++++++++++--- > Koha/Schema/Result/Category.pm | 19 +++++++++++++-- > 2 files changed, 41 insertions(+), 5 deletions(-) > >diff --git a/Koha/Schema/Result/BorrowerAttributeType.pm b/Koha/Schema/Result/BorrowerAttributeType.pm >index ce969376baa..9a4b7125ce6 100644 >--- a/Koha/Schema/Result/BorrowerAttributeType.pm >+++ b/Koha/Schema/Result/BorrowerAttributeType.pm >@@ -98,6 +98,7 @@ defines if this field displays in checkout screens > =head2 category_code > > data_type: 'varchar' >+ is_foreign_key: 1 > is_nullable: 1 > size: 10 > >@@ -150,7 +151,7 @@ __PACKAGE__->add_columns( > "display_checkout", > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > "category_code", >- { data_type => "varchar", is_nullable => 1, size => 10 }, >+ { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, > "class", > { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, > "keep_for_pseudonymization", >@@ -203,6 +204,26 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 category_code >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Category> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "category_code", >+ "Koha::Schema::Result::Category", >+ { categorycode => "category_code" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "RESTRICT", >+ on_update => "RESTRICT", >+ }, >+); >+ > =head2 pseudonymized_borrower_attributes > > Type: has_many >@@ -219,8 +240,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:a/IA2iqSJqg3oOS+o1nXFg >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-25 12:50:55 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VgJP4Ugfz0sN3YoJk/tshA > > __PACKAGE__->add_columns( > '+keep_for_pseudonymization' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm >index 567bf333298..6319df90d41 100644 >--- a/Koha/Schema/Result/Category.pm >+++ b/Koha/Schema/Result/Category.pm >@@ -268,6 +268,21 @@ __PACKAGE__->set_primary_key("categorycode"); > > =head1 RELATIONS > >+=head2 borrower_attribute_types >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::BorrowerAttributeType> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "borrower_attribute_types", >+ "Koha::Schema::Result::BorrowerAttributeType", >+ { "foreign.category_code" => "self.categorycode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 borrower_message_preferences > > Type: has_many >@@ -329,8 +344,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-19 14:20:11 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xrnHXXv5sd3S2sMEKzHLmA >+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-25 12:50:56 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vEpp1HRkUOvPyWd/yAsxng > > __PACKAGE__->add_columns( > '+exclude_from_local_holds_priority' => { is_boolean => 1 }, >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30449
:
132965
|
132966
|
133777
|
133778
|
133779
|
133883
|
133884
|
133885