]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB/Result/BugBlock.pm
switch to compatibility level 12
[debbugs.git] / Debbugs / DB / Result / BugBlock.pm
index 074b29b06ab1290426c7dc7d303a5495ff28ce18..0200a313657d0fe0c4996ddf8960039aa9c91f8a 100644 (file)
@@ -6,7 +6,7 @@ package Debbugs::DB::Result::BugBlock;
 
 =head1 NAME
 
-Debbugs::DB::Result::BugBlock
+Debbugs::DB::Result::BugBlock - Bugs which block other bugs
 
 =cut
 
@@ -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_blocks>
 
@@ -35,34 +37,64 @@ __PACKAGE__->table("bug_blocks");
 
 =head1 ACCESSORS
 
-=head2 bug_id
+=head2 id
+
+  data_type: 'integer'
+  is_auto_increment: 1
+  is_nullable: 0
+  sequence: 'bug_blocks_id_seq'
+
+=head2 bug
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 0
 
+Bug number
+
 =head2 blocks
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 0
 
+Bug number which is blocked by bug
+
 =cut
 
 __PACKAGE__->add_columns(
-  "bug_id",
+  "id",
+  {
+    data_type         => "integer",
+    is_auto_increment => 1,
+    is_nullable       => 0,
+    sequence          => "bug_blocks_id_seq",
+  },
+  "bug",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "blocks",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
 );
 
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
 =head1 UNIQUE CONSTRAINTS
 
 =head2 C<bug_blocks_bug_id_blocks_idx>
 
 =over 4
 
-=item * L</bug_id>
+=item * L</bug>
 
 =item * L</blocks>
 
@@ -70,7 +102,7 @@ __PACKAGE__->add_columns(
 
 =cut
 
-__PACKAGE__->add_unique_constraint("bug_blocks_bug_id_blocks_idx", ["bug_id", "blocks"]);
+__PACKAGE__->add_unique_constraint("bug_blocks_bug_id_blocks_idx", ["bug", "blocks"]);
 
 =head1 RELATIONS
 
@@ -86,7 +118,7 @@ __PACKAGE__->belongs_to(
   "block",
   "Debbugs::DB::Result::Bug",
   { id => "blocks" },
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
 );
 
 =head2 bug
@@ -100,14 +132,21 @@ Related object: L<Debbugs::DB::Result::Bug>
 __PACKAGE__->belongs_to(
   "bug",
   "Debbugs::DB::Result::Bug",
-  { id => "bug_id" },
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+  { id => "bug" },
+  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-07-17 10:25:29
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:adv4v35ZqedSG4L0CFNPMg
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-11-30 21:56:51
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rkt0XlA4r2YFX0KnUZmS6A
+
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    for my $idx (qw(bug blocks)) {
+       $sqlt_table->add_index(name => 'bug_blocks_'.$idx.'_idx',
+                              fields => [$idx]);
+    }
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;