]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB/Result/BugMessage.pm
switch to compatibility level 12
[debbugs.git] / Debbugs / DB / Result / BugMessage.pm
index ca6d7617de179d1f9f7c8fd638f0efb8253590e2..b5fccc558984ef1c1f641dbbfdadaa0bccee1e8e 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<bug_message>
 
@@ -41,22 +43,37 @@ __PACKAGE__->table("bug_message");
   is_foreign_key: 1
   is_nullable: 0
 
+Bug id (matches bug)
+
 =head2 message
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 0
 
+Message id (matches message)
+
 =head2 message_number
 
   data_type: 'integer'
   is_nullable: 0
 
+Message number in the bug log
+
 =head2 bug_log_offset
 
   data_type: 'integer'
   is_nullable: 1
 
+Byte offset in the bug log
+
+=head2 offset_valid
+
+  data_type: 'timestamp with time zone'
+  is_nullable: 1
+
+Time offset was valid
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -68,8 +85,26 @@ __PACKAGE__->add_columns(
   { data_type => "integer", is_nullable => 0 },
   "bug_log_offset",
   { data_type => "integer", is_nullable => 1 },
+  "offset_valid",
+  { data_type => "timestamp with time zone", is_nullable => 1 },
 );
 
+=head1 UNIQUE CONSTRAINTS
+
+=head2 C<bug_message_bug_message_idx>
+
+=over 4
+
+=item * L</bug>
+
+=item * L</message>
+
+=back
+
+=cut
+
+__PACKAGE__->add_unique_constraint("bug_message_bug_message_idx", ["bug", "message"]);
+
 =head1 RELATIONS
 
 =head2 bug
@@ -84,7 +119,7 @@ __PACKAGE__->belongs_to(
   "bug",
   "Debbugs::DB::Result::Bug",
   { id => "bug" },
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+  { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
 =head2 message
@@ -99,13 +134,17 @@ __PACKAGE__->belongs_to(
   "message",
   "Debbugs::DB::Result::Message",
   { id => "message" },
-  { 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 @ 2012-11-29 15:37:55
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7CxTYa/jUyoOVan9Sj9MZQ
-
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BRbN9C6P/wvWWmSmjNGjLA
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    $sqlt_table->add_index(name => 'bug_message_idx_bug_message_number',
+                          fields => [qw(bug message_number)],
+                         );
+}
 1;