From a86e69c86bd99e463e6702ee487e18af7a9cb79a Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 5 Nov 2014 08:32:14 -0300 Subject: [PATCH] Bug 11425: Update DBIx Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/AuthorisedValue.pm | 19 ++++- Koha/Schema/Result/ItemsSearchField.pm | 112 +++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 Koha/Schema/Result/ItemsSearchField.pm diff --git a/Koha/Schema/Result/AuthorisedValue.pm b/Koha/Schema/Result/AuthorisedValue.pm index 0366aecb65..3cd8cce6fd 100644 --- a/Koha/Schema/Result/AuthorisedValue.pm +++ b/Koha/Schema/Result/AuthorisedValue.pm @@ -107,9 +107,24 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 items_search_fields -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N6Q7Y4sHL03X170zJ3APUA +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 @ 2014-11-04 19:23:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aaIEvlA6wPG2o0Zx2JGk6A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/ItemsSearchField.pm b/Koha/Schema/Result/ItemsSearchField.pm new file mode 100644 index 0000000000..876023cb0b --- /dev/null +++ b/Koha/Schema/Result/ItemsSearchField.pm @@ -0,0 +1,112 @@ +use utf8; +package Koha::Schema::Result::ItemsSearchField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ItemsSearchField + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("items_search_fields"); + +=head1 ACCESSORS + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 label + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 tagfield + + data_type: 'char' + is_nullable: 0 + size: 3 + +=head2 tagsubfield + + data_type: 'char' + is_nullable: 1 + size: 1 + +=head2 authorised_values_category + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 16 + +=cut + +__PACKAGE__->add_columns( + "name", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "label", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "tagfield", + { data_type => "char", is_nullable => 0, size => 3 }, + "tagsubfield", + { data_type => "char", is_nullable => 1, size => 1 }, + "authorised_values_category", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 16 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("name"); + +=head1 RELATIONS + +=head2 authorised_values_category + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "authorised_values_category", + "Koha::Schema::Result::AuthorisedValue", + { category => "authorised_values_category" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-11-04 19:23:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4zpzfz1VNYNVM5M/btiPOA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.20.1