From 8b32768df8ef773f386f9a2eee1c2f94c7bd5f99 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 29 Aug 2016 14:05:51 +0100 Subject: [PATCH] Bug 17216: DBIC Schema changes --- Koha/Schema/Result/AuthorisedValue.pm | 19 +------ Koha/Schema/Result/AuthorisedValueCategory.pm | 74 +++++++++++++++++++++++++++ Koha/Schema/Result/ItemsSearchField.pm | 14 ++--- 3 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 Koha/Schema/Result/AuthorisedValueCategory.pm diff --git a/Koha/Schema/Result/AuthorisedValue.pm b/Koha/Schema/Result/AuthorisedValue.pm index 4818378..d1f6af6 100644 --- a/Koha/Schema/Result/AuthorisedValue.pm +++ b/Koha/Schema/Result/AuthorisedValue.pm @@ -107,24 +107,9 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 items_search_fields -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "items_search_fields", - "Koha::Schema::Result::ItemsSearchField", - { "foreign.authorised_values_category" => "self.category" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - - -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-05 15:20:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GS7UBpk66HAhBptwrpKR7Q +# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-08-29 11:50:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VtpTwYpCMG3VVmsrQspdxw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/AuthorisedValueCategory.pm b/Koha/Schema/Result/AuthorisedValueCategory.pm new file mode 100644 index 0000000..c5de266 --- /dev/null +++ b/Koha/Schema/Result/AuthorisedValueCategory.pm @@ -0,0 +1,74 @@ +use utf8; +package Koha::Schema::Result::AuthorisedValueCategory; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::AuthorisedValueCategory + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("authorised_value_categories"); + +=head1 ACCESSORS + +=head2 category_name + + data_type: 'varchar' + is_nullable: 0 + size: 80 + +=cut + +__PACKAGE__->add_columns( + "category_name", + { data_type => "varchar", is_nullable => 0, size => 80 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("category_name"); + +=head1 RELATIONS + +=head2 items_search_fields + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "items_search_fields", + "Koha::Schema::Result::ItemsSearchField", + { "foreign.authorised_values_category" => "self.category_name" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-08-29 11:50:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fF91wGF5/xHvp8JX5fAAtw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ItemsSearchField.pm b/Koha/Schema/Result/ItemsSearchField.pm index 3b6e6be..cd76971 100644 --- a/Koha/Schema/Result/ItemsSearchField.pm +++ b/Koha/Schema/Result/ItemsSearchField.pm @@ -52,7 +52,7 @@ __PACKAGE__->table("items_search_fields"); data_type: 'varchar' is_foreign_key: 1 is_nullable: 1 - size: 32 + size: 80 =cut @@ -66,7 +66,7 @@ __PACKAGE__->add_columns( "tagsubfield", { data_type => "char", is_nullable => 1, size => 1 }, "authorised_values_category", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 32 }, + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 }, ); =head1 PRIMARY KEY @@ -87,14 +87,14 @@ __PACKAGE__->set_primary_key("name"); Type: belongs_to -Related object: L +Related object: L =cut __PACKAGE__->belongs_to( "authorised_values_category", - "Koha::Schema::Result::AuthorisedValue", - { category => "authorised_values_category" }, + "Koha::Schema::Result::AuthorisedValueCategory", + { category_name => "authorised_values_category" }, { is_deferrable => 1, join_type => "LEFT", @@ -104,8 +104,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-02-05 15:20:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oHoTxnECC/702vwFO4vdqw +# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-08-29 11:50:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5iB4gfxlZLHw2fqwoK/Wtg # You can replace this text with custom code or comments, and it will be preserved on regeneration -- 2.8.1