Bug 9016: (follow-up) update DBIC schema classes
authorGalen Charlton <gmc@esilibrary.com>
Fri, 2 May 2014 18:05:09 +0000 (18:05 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 2 May 2014 20:29:18 +0000 (20:29 +0000)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Koha/Schema/Result/Letter.pm
Koha/Schema/Result/MessageTransportType.pm
Koha/Schema/Result/Overduerule.pm
Koha/Schema/Result/OverduerulesTransportType.pm [new file with mode: 0644]

index 95345f7..04261e2 100644 (file)
@@ -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</branchcode>
 
+=item * L</message_transport_type>
+
 =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<Koha::Schema::Result::MessageTransportType>
+
+=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
index 8863a2d..775d9a2 100644 (file)
@@ -67,6 +67,23 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 letters
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::Letter>
+
+=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<Koha::Schema::Result::OverduerulesTransportType>
+
+=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
index e985dd8..8392d1a 100644 (file)
@@ -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<Koha::Schema::Result::OverduerulesTransportType>
+
+=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 (file)
index 0000000..d93f32c
--- /dev/null
@@ -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<overduerules_transport_types>
+
+=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</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 RELATIONS
+
+=head2 message_transport_type
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::MessageTransportType>
+
+=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<Koha::Schema::Result::Overduerule>
+
+=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;