From 45a6e7efd1c0df56320055b8dd9c56ab6899197c Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 2 May 2014 18:05:09 +0000 Subject: [PATCH] Bug 9016: (follow-up) update DBIC schema classes Signed-off-by: Galen Charlton --- Koha/Schema/Result/Letter.pm | 39 ++++- Koha/Schema/Result/MessageTransportType.pm | 38 ++++- Koha/Schema/Result/Overduerule.pm | 24 ++- .../Result/OverduerulesTransportType.pm | 145 ++++++++++++++++++ 4 files changed, 239 insertions(+), 7 deletions(-) create mode 100644 Koha/Schema/Result/OverduerulesTransportType.pm diff --git a/Koha/Schema/Result/Letter.pm b/Koha/Schema/Result/Letter.pm index 95345f74fa..04261e27a0 100644 --- a/Koha/Schema/Result/Letter.pm +++ b/Koha/Schema/Result/Letter.pm @@ -69,6 +69,14 @@ __PACKAGE__->table("letter"); data_type: 'text' is_nullable: 1 +=head2 message_transport_type + + data_type: 'varchar' + default_value: 'email' + is_foreign_key: 1 + is_nullable: 0 + size: 20 + =cut __PACKAGE__->add_columns( @@ -86,6 +94,14 @@ __PACKAGE__->add_columns( { data_type => "varchar", default_value => "", is_nullable => 0, size => 200 }, "content", { data_type => "text", is_nullable => 1 }, + "message_transport_type", + { + data_type => "varchar", + default_value => "email", + is_foreign_key => 1, + is_nullable => 0, + size => 20, + }, ); =head1 PRIMARY KEY @@ -98,14 +114,31 @@ __PACKAGE__->add_columns( =item * L +=item * L + =back =cut -__PACKAGE__->set_primary_key("module", "code", "branchcode"); +__PACKAGE__->set_primary_key("module", "code", "branchcode", "message_transport_type"); =head1 RELATIONS +=head2 message_transport_type + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "message_transport_type", + "Koha::Schema::Result::MessageTransportType", + { message_transport_type => "message_transport_type" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + =head2 message_transports Type: has_many @@ -126,8 +159,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:Lc0RfG7k0QwnWCDywFImLg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-05-02 18:04:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HFUQ+/BKlweHglzOlm0lUQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/MessageTransportType.pm b/Koha/Schema/Result/MessageTransportType.pm index 8863a2d5a6..775d9a250e 100644 --- a/Koha/Schema/Result/MessageTransportType.pm +++ b/Koha/Schema/Result/MessageTransportType.pm @@ -67,6 +67,23 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 letters + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "letters", + "Koha::Schema::Result::Letter", + { + "foreign.message_transport_type" => "self.message_transport_type", + }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 message_queues Type: has_many @@ -101,6 +118,23 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 overduerules_transport_types + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "overduerules_transport_types", + "Koha::Schema::Result::OverduerulesTransportType", + { + "foreign.message_transport_type" => "self.message_transport_type", + }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 borrower_message_preferences Type: many_to_many @@ -116,8 +150,8 @@ __PACKAGE__->many_to_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UApxVVoE1dZpL6HP1kytJQ +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-05-02 18:04:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YpzL/dxDWq//5vqXfvHoVQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Overduerule.pm b/Koha/Schema/Result/Overduerule.pm index e985dd8db1..8392d1a9e0 100644 --- a/Koha/Schema/Result/Overduerule.pm +++ b/Koha/Schema/Result/Overduerule.pm @@ -131,9 +131,29 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("branchcode", "categorycode"); +=head1 RELATIONS -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hP/0cV6iad2dz8kIhCYFjw +=head2 overduerules_transport_types + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "overduerules_transport_types", + "Koha::Schema::Result::OverduerulesTransportType", + { + "foreign.branchcode" => "self.branchcode", + "foreign.categorycode" => "self.categorycode", + }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-05-02 18:04:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zQK4gTxkrPPwJzujbZxxdg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/OverduerulesTransportType.pm b/Koha/Schema/Result/OverduerulesTransportType.pm new file mode 100644 index 0000000000..d93f32c7ba --- /dev/null +++ b/Koha/Schema/Result/OverduerulesTransportType.pm @@ -0,0 +1,145 @@ +use utf8; +package Koha::Schema::Result::OverduerulesTransportType; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::OverduerulesTransportType + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("overduerules_transport_types"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 branchcode + + data_type: 'varchar' + default_value: (empty string) + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=head2 categorycode + + data_type: 'varchar' + default_value: (empty string) + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=head2 letternumber + + data_type: 'integer' + default_value: 1 + is_nullable: 0 + +=head2 message_transport_type + + data_type: 'varchar' + default_value: 'email' + is_foreign_key: 1 + is_nullable: 0 + size: 20 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "branchcode", + { + data_type => "varchar", + default_value => "", + is_foreign_key => 1, + is_nullable => 0, + size => 10, + }, + "categorycode", + { + data_type => "varchar", + default_value => "", + is_foreign_key => 1, + is_nullable => 0, + size => 10, + }, + "letternumber", + { data_type => "integer", default_value => 1, is_nullable => 0 }, + "message_transport_type", + { + data_type => "varchar", + default_value => "email", + is_foreign_key => 1, + is_nullable => 0, + size => 20, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 message_transport_type + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "message_transport_type", + "Koha::Schema::Result::MessageTransportType", + { message_transport_type => "message_transport_type" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 overduerule + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "overduerule", + "Koha::Schema::Result::Overduerule", + { branchcode => "branchcode", categorycode => "categorycode" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-05-02 18:04:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mNvLssJ8h9WFNQaB+YCGYg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.39.5