Bug 17216: DBIC Schema changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-08-29 14:05:51 +01:00 committed by Brendan Gallagher
parent ef19f6705a
commit d7badeaafa
3 changed files with 83 additions and 24 deletions

View file

@ -107,24 +107,9 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 items_search_fields
Type: has_many
Related object: L<Koha::Schema::Result::ItemsSearchField>
=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

View file

@ -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<authorised_value_categories>
=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</category_name>
=back
=cut
__PACKAGE__->set_primary_key("category_name");
=head1 RELATIONS
=head2 items_search_fields
Type: has_many
Related object: L<Koha::Schema::Result::ItemsSearchField>
=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;

View file

@ -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<Koha::Schema::Result::AuthorisedValue>
Related object: L<Koha::Schema::Result::AuthorisedValueCategory>
=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