Bugzilla – Attachment 143113 Details for
Bug 26573
Limit patron attribute types to more than one patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[DO NOT PUSH] DBIX schema update
DO-NOT-PUSH-DBIX-schema-update.patch (text/plain), 8.88 KB, created by
Victor Grousset/tuxayo
on 2022-11-03 13:34:06 UTC
(
hide
)
Description:
[DO NOT PUSH] DBIX schema update
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2022-11-03 13:34:06 UTC
Size:
8.88 KB
patch
obsolete
>From 8f044af0d283893edc24cd477dc95c78ee4b7a40 Mon Sep 17 00:00:00 2001 >From: Victor Grousset/tuxayo <victor@tuxayo.net> >Date: Thu, 3 Nov 2022 14:30:04 +0100 >Subject: [PATCH] [DO NOT PUSH] DBIX schema update > >https://bugs.koha-community.org/show_bug.cgi?id=26573 >--- > Koha/Schema/Result/BorrowerAttributeType.pm | 60 +++++------ > .../Result/BorrowerAttributeTypesCategory.pm | 101 ++++++++++++++++++ > Koha/Schema/Result/Category.pm | 28 +++-- > Koha/Schema/Result/TmpHoldsqueue.pm | 20 +++- > 4 files changed, 169 insertions(+), 40 deletions(-) > create mode 100644 Koha/Schema/Result/BorrowerAttributeTypesCategory.pm > >diff --git a/Koha/Schema/Result/BorrowerAttributeType.pm b/Koha/Schema/Result/BorrowerAttributeType.pm >index 9a4b7125ce..17c95a76f0 100644 >--- a/Koha/Schema/Result/BorrowerAttributeType.pm >+++ b/Koha/Schema/Result/BorrowerAttributeType.pm >@@ -95,15 +95,6 @@ foreign key from authorised_values that links this custom field to an authorized > > defines if this field displays in checkout screens > >-=head2 category_code >- >- data_type: 'varchar' >- is_foreign_key: 1 >- is_nullable: 1 >- size: 10 >- >-defines a category for an attribute_type >- > =head2 class > > data_type: 'varchar' >@@ -150,8 +141,6 @@ __PACKAGE__->add_columns( > { data_type => "varchar", is_nullable => 1, size => 32 }, > "display_checkout", > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >- "category_code", >- { 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", >@@ -189,39 +178,34 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 borrower_attributes >+=head2 borrower_attribute_types_categories > > Type: has_many > >-Related object: L<Koha::Schema::Result::BorrowerAttribute> >+Related object: L<Koha::Schema::Result::BorrowerAttributeTypesCategory> > > =cut > > __PACKAGE__->has_many( >- "borrower_attributes", >- "Koha::Schema::Result::BorrowerAttribute", >- { "foreign.code" => "self.code" }, >+ "borrower_attribute_types_categories", >+ "Koha::Schema::Result::BorrowerAttributeTypesCategory", >+ { "foreign.borrower_attribute_type_code" => "self.code" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); > >-=head2 category_code >+=head2 borrower_attributes > >-Type: belongs_to >+Type: has_many > >-Related object: L<Koha::Schema::Result::Category> >+Related object: L<Koha::Schema::Result::BorrowerAttribute> > > =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", >- }, >+__PACKAGE__->has_many( >+ "borrower_attributes", >+ "Koha::Schema::Result::BorrowerAttribute", >+ { "foreign.code" => "self.code" }, >+ { cascade_copy => 0, cascade_delete => 0 }, > ); > > =head2 pseudonymized_borrower_attributes >@@ -239,9 +223,23 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 categorycodes >+ >+Type: many_to_many >+ >+Composing rels: L</borrower_attribute_types_categories> -> categorycode >+ >+=cut >+ >+__PACKAGE__->many_to_many( >+ "categorycodes", >+ "borrower_attribute_types_categories", >+ "categorycode", >+); >+ > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-25 12:50:55 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VgJP4Ugfz0sN3YoJk/tshA >+# Created by DBIx::Class::Schema::Loader v0.07048 @ 2022-11-03 13:31:18 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Y08Zohgrnb412pc62ncRfg > > __PACKAGE__->add_columns( > '+keep_for_pseudonymization' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/BorrowerAttributeTypesCategory.pm b/Koha/Schema/Result/BorrowerAttributeTypesCategory.pm >new file mode 100644 >index 0000000000..afd8ecb688 >--- /dev/null >+++ b/Koha/Schema/Result/BorrowerAttributeTypesCategory.pm >@@ -0,0 +1,101 @@ >+use utf8; >+package Koha::Schema::Result::BorrowerAttributeTypesCategory; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::BorrowerAttributeTypesCategory >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<borrower_attribute_types_categories> >+ >+=cut >+ >+__PACKAGE__->table("borrower_attribute_types_categories"); >+ >+=head1 ACCESSORS >+ >+=head2 borrower_attribute_type_code >+ >+ data_type: 'varchar' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ size: 10 >+ >+=head2 categorycode >+ >+ data_type: 'varchar' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ size: 10 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "borrower_attribute_type_code", >+ { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, >+ "categorycode", >+ { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</borrower_attribute_type_code> >+ >+=item * L</categorycode> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("borrower_attribute_type_code", "categorycode"); >+ >+=head1 RELATIONS >+ >+=head2 borrower_attribute_type_code >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::BorrowerAttributeType> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "borrower_attribute_type_code", >+ "Koha::Schema::Result::BorrowerAttributeType", >+ { code => "borrower_attribute_type_code" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+=head2 categorycode >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Category> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "categorycode", >+ "Koha::Schema::Result::Category", >+ { categorycode => "categorycode" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07048 @ 2022-11-03 13:31:18 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qDLi69AE+gI/P6b6aeQXcw >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm >index ca935d98e2..89fdfe271a 100644 >--- a/Koha/Schema/Result/Category.pm >+++ b/Koha/Schema/Result/Category.pm >@@ -287,18 +287,18 @@ __PACKAGE__->set_primary_key("categorycode"); > > =head1 RELATIONS > >-=head2 borrower_attribute_types >+=head2 borrower_attribute_types_categories > > Type: has_many > >-Related object: L<Koha::Schema::Result::BorrowerAttributeType> >+Related object: L<Koha::Schema::Result::BorrowerAttributeTypesCategory> > > =cut > > __PACKAGE__->has_many( >- "borrower_attribute_types", >- "Koha::Schema::Result::BorrowerAttributeType", >- { "foreign.category_code" => "self.categorycode" }, >+ "borrower_attribute_types_categories", >+ "Koha::Schema::Result::BorrowerAttributeTypesCategory", >+ { "foreign.categorycode" => "self.categorycode" }, > { cascade_copy => 0, cascade_delete => 0 }, > ); > >@@ -362,9 +362,23 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 borrower_attribute_type_codes >+ >+Type: many_to_many >+ >+Composing rels: L</borrower_attribute_types_categories> -> borrower_attribute_type_code >+ >+=cut >+ >+__PACKAGE__->many_to_many( >+ "borrower_attribute_type_codes", >+ "borrower_attribute_types_categories", >+ "borrower_attribute_type_code", >+); >+ > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-23 16:29:27 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SKWF2QpqQtXoujwurKFQhA >+# Created by DBIx::Class::Schema::Loader v0.07048 @ 2022-11-03 13:31:18 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KsnusPPFV49wWCxBNX5vtQ > > sub koha_object_class { > 'Koha::Patron::Category'; >diff --git a/Koha/Schema/Result/TmpHoldsqueue.pm b/Koha/Schema/Result/TmpHoldsqueue.pm >index 1c14d69a30..f2ae3e8b7b 100644 >--- a/Koha/Schema/Result/TmpHoldsqueue.pm >+++ b/Koha/Schema/Result/TmpHoldsqueue.pm >@@ -108,6 +108,15 @@ __PACKAGE__->table("tmp_holdsqueue"); > default_value: 0 > is_nullable: 0 > >+=head2 timestamp >+ >+ data_type: 'timestamp' >+ datetime_undef_if_invalid: 1 >+ default_value: current_timestamp >+ is_nullable: 0 >+ >+date and time this entry as added/last updated >+ > =cut > > __PACKAGE__->add_columns( >@@ -141,6 +150,13 @@ __PACKAGE__->add_columns( > { data_type => "mediumtext", is_nullable => 1 }, > "item_level_request", > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ "timestamp", >+ { >+ data_type => "timestamp", >+ datetime_undef_if_invalid => 1, >+ default_value => \"current_timestamp", >+ is_nullable => 0, >+ }, > ); > > =head1 RELATIONS >@@ -201,8 +217,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-20 12:00:15 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ytvFiixR/AIAgTV/5sewcQ >+# Created by DBIx::Class::Schema::Loader v0.07048 @ 2022-11-03 13:28:56 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1/MqWc4gU6Oirlw+PuJFNw > > > # You can replace this text with custom content, and it will be preserved on regeneration >-- >2.38.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 26573
:
139823
|
143113
|
143114
|
143115
|
143116
|
144470
|
144471
|
159210
|
159211
|
171048