From fda60fad3a8ba05d8d126a72b98ad4b397aabdaa Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 18 May 2015 11:24:12 -0300 Subject: [PATCH] Bug 8480: (RM followup) DBIx updates Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/AuthSubfieldStructure.pm | 30 ++++++++++++++++++--- Koha/Schema/Result/AuthType.pm | 19 +++++++++++-- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/Koha/Schema/Result/AuthSubfieldStructure.pm b/Koha/Schema/Result/AuthSubfieldStructure.pm index 8c16d3e9d5..0ae35a7083 100644 --- a/Koha/Schema/Result/AuthSubfieldStructure.pm +++ b/Koha/Schema/Result/AuthSubfieldStructure.pm @@ -27,6 +27,7 @@ __PACKAGE__->table("auth_subfield_structure"); data_type: 'varchar' default_value: (empty string) + is_foreign_key: 1 is_nullable: 0 size: 10 @@ -133,7 +134,13 @@ __PACKAGE__->table("auth_subfield_structure"); __PACKAGE__->add_columns( "authtypecode", - { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, + { + data_type => "varchar", + default_value => "", + is_foreign_key => 1, + is_nullable => 0, + size => 10, + }, "tagfield", { data_type => "varchar", default_value => "", is_nullable => 0, size => 3 }, "tagsubfield", @@ -184,9 +191,26 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("authtypecode", "tagfield", "tagsubfield"); +=head1 RELATIONS + +=head2 authtypecode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "authtypecode", + "Koha::Schema::Result::AuthType", + { authtypecode => "authtypecode" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:24BKrmX1lug68+rmXE1riA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-05-18 11:22:30 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ymm26DwMwBskOjIj1qhWFA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/AuthType.pm b/Koha/Schema/Result/AuthType.pm index d4a7d778e3..7191a9f0d2 100644 --- a/Koha/Schema/Result/AuthType.pm +++ b/Koha/Schema/Result/AuthType.pm @@ -76,6 +76,21 @@ __PACKAGE__->set_primary_key("authtypecode"); =head1 RELATIONS +=head2 auth_subfield_structures + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "auth_subfield_structures", + "Koha::Schema::Result::AuthSubfieldStructure", + { "foreign.authtypecode" => "self.authtypecode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 auth_tag_structures Type: has_many @@ -92,8 +107,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sy0+bAJuYz5t9OVCq0Vo8Q +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-05-18 11:22:30 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FELYJXziUcU7+b/X8SaDwA # You can replace this text with custom content, and it will be preserved on regeneration -- 2.39.5