]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB/Result/CorrespondentFullName.pm
we don't necessarily need to deparse the email address for pkg links
[debbugs.git] / Debbugs / DB / Result / CorrespondentFullName.pm
index 738004b09bae0bddae65e3226f7ee7b0df1a8aed..a5be28391424693094157a86ad4076eb594485d5 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<correspondent_full_name>
 
@@ -35,21 +37,14 @@ __PACKAGE__->table("correspondent_full_name");
 
 =head1 ACCESSORS
 
-=head2 id
-
-  data_type: 'integer'
-  is_auto_increment: 1
-  is_nullable: 0
-  sequence: 'correspondent_full_name_id_seq'
-
-Correspondent full name id
-
 =head2 correspondent
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 0
 
+Correspondent ID (matches correspondent)
+
 =head2 full_name
 
   data_type: 'text'
@@ -57,34 +52,29 @@ Correspondent full name id
 
 Correspondent full name (includes e-mail address)
 
+=head2 last_seen
+
+  data_type: 'timestamp'
+  default_value: current_timestamp
+  is_nullable: 0
+  original: {default_value => \"now()"}
+
 =cut
 
 __PACKAGE__->add_columns(
-  "id",
-  {
-    data_type         => "integer",
-    is_auto_increment => 1,
-    is_nullable       => 0,
-    sequence          => "correspondent_full_name_id_seq",
-  },
   "correspondent",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "full_name",
   { data_type => "text", is_nullable => 0 },
+  "last_seen",
+  {
+    data_type     => "timestamp",
+    default_value => \"current_timestamp",
+    is_nullable   => 0,
+    original      => { default_value => \"now()" },
+  },
 );
 
-=head1 PRIMARY KEY
-
-=over 4
-
-=item * L</id>
-
-=back
-
-=cut
-
-__PACKAGE__->set_primary_key("id");
-
 =head1 UNIQUE CONSTRAINTS
 
 =head2 C<correspondent_full_name_correspondent_full_name_idx>
@@ -118,13 +108,19 @@ __PACKAGE__->belongs_to(
   "correspondent",
   "Debbugs::DB::Result::Correspondent",
   { id => "correspondent" },
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+  { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-04-01 17:05:37
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xGcJNDjhN+ehcFQYzaBxBw
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2Ac8mrDV2IsE/11YsYoqQQ
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    for my $idx (qw(full_name last_seen)) {
+       $sqlt_table->add_index(name => 'correspondent_full_name_idx_'.$idx,
+                              fields => [$idx]);
+    }
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;