]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB/Result/Message.pm
Merge remote-tracking branch 'origin/master' into database
[debbugs.git] / Debbugs / DB / Result / Message.pm
index 70b876d545dac16ad4601e73b77f9f1f8e264d9b..cd42f48efef4bbabd3a8cb46de904e722b01c2f7 100644 (file)
@@ -21,11 +21,13 @@ use base 'DBIx::Class::Core';
 
 =item * L<DBIx::Class::InflateColumn::DateTime>
 
+=item * L<DBIx::Class::TimeStamp>
+
 =back
 
 =cut
 
-__PACKAGE__->load_components("InflateColumn::DateTime");
+__PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp");
 
 =head1 TABLE: C<message>
 
@@ -47,38 +49,27 @@ Message id
 =head2 msgid
 
   data_type: 'text'
-  is_nullable: 1
+  default_value: (empty string)
+  is_nullable: 0
 
 Message id header
 
 =head2 from_complete
 
   data_type: 'text'
-  is_nullable: 1
+  default_value: (empty string)
+  is_nullable: 0
 
 Complete from header of message
 
-=head2 from_addr
-
-  data_type: 'text'
-  is_nullable: 1
-
-Address(es) of From: headers
-
 =head2 to_complete
 
   data_type: 'text'
-  is_nullable: 1
+  default_value: (empty string)
+  is_nullable: 0
 
 Complete to header of message
 
-=head2 to_addr
-
-  data_type: 'text'
-  is_nullable: 1
-
-Address(es) of To: header
-
 =head2 subject
 
   data_type: 'text'
@@ -105,7 +96,8 @@ Contents of References: header
 =head2 spam_score
 
   data_type: 'double precision'
-  is_nullable: 1
+  default_value: 0
+  is_nullable: 0
 
 Spam score from spamassassin
 
@@ -113,7 +105,7 @@ Spam score from spamassassin
 
   data_type: 'boolean'
   default_value: false
-  is_nullable: 1
+  is_nullable: 0
 
 True if this message was spam and should not be shown
 
@@ -128,15 +120,11 @@ __PACKAGE__->add_columns(
     sequence          => "message_id_seq",
   },
   "msgid",
-  { data_type => "text", is_nullable => 1 },
+  { data_type => "text", default_value => "", is_nullable => 0 },
   "from_complete",
-  { data_type => "text", is_nullable => 1 },
-  "from_addr",
-  { data_type => "text", is_nullable => 1 },
+  { data_type => "text", default_value => "", is_nullable => 0 },
   "to_complete",
-  { data_type => "text", is_nullable => 1 },
-  "to_addr",
-  { data_type => "text", is_nullable => 1 },
+  { data_type => "text", default_value => "", is_nullable => 0 },
   "subject",
   { data_type => "text", default_value => "", is_nullable => 0 },
   "sent_date",
@@ -144,9 +132,9 @@ __PACKAGE__->add_columns(
   "refs",
   { data_type => "text", default_value => "", is_nullable => 0 },
   "spam_score",
-  { data_type => "double precision", is_nullable => 1 },
+  { data_type => "double precision", default_value => 0, is_nullable => 0 },
   "is_spam",
-  { data_type => "boolean", default_value => \"false", is_nullable => 1 },
+  { data_type => "boolean", default_value => \"false", is_nullable => 0 },
 );
 
 =head1 PRIMARY KEY
@@ -161,6 +149,29 @@ __PACKAGE__->add_columns(
 
 __PACKAGE__->set_primary_key("id");
 
+=head1 UNIQUE CONSTRAINTS
+
+=head2 C<message_msgid_from_complete_to_complete_subject_idx>
+
+=over 4
+
+=item * L</msgid>
+
+=item * L</from_complete>
+
+=item * L</to_complete>
+
+=item * L</subject>
+
+=back
+
+=cut
+
+__PACKAGE__->add_unique_constraint(
+  "message_msgid_from_complete_to_complete_subject_idx",
+  ["msgid", "from_complete", "to_complete", "subject"],
+);
+
 =head1 RELATIONS
 
 =head2 bug_messages
@@ -224,9 +235,21 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M6k3YCfOyYLnQJ+qBcoJlQ
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-07 19:03:32
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:n8U0vD9R8M5wFoeoLlIWeQ
+
+__PACKAGE__->many_to_many(bugs => 'bug_messages','bug');
+__PACKAGE__->many_to_many(correspondents => 'message_correspondents','correspondent');
+__PACKAGE__->many_to_many(references => 'message_refs_message','message');
+__PACKAGE__->many_to_many(referenced_by => 'message_refs_refs','message');
+
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    for my $idx (qw(msgid subject)) {
+       $sqlt_table->add_index(name => 'message_'.$idx.'_idx',
+                              fields => [$idx]);
+    }
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;