]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB/Result/BinVer.pm
fix var typo and add in missing correspondent index
[debbugs.git] / Debbugs / DB / Result / BinVer.pm
index 688b7fe0713f9f977f26c0ecbbdf93bd584b7da0..30be6c2411d7827822b700411ad4be0d4cd3dc64 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<bin_ver>
 
@@ -52,7 +54,7 @@ Binary version id
 
 Binary package id (matches bin_pkg)
 
-=head2 src_ver_id
+=head2 src_ver
 
   data_type: 'integer'
   is_foreign_key: 1
@@ -60,7 +62,7 @@ Binary package id (matches bin_pkg)
 
 Source version (matchines src_ver)
 
-=head2 arch_id
+=head2 arch
 
   data_type: 'integer'
   is_foreign_key: 1
@@ -87,9 +89,9 @@ __PACKAGE__->add_columns(
   },
   "bin_pkg",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
-  "src_ver_id",
+  "src_ver",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
-  "arch_id",
+  "arch",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "ver",
   { data_type => "debversion", is_nullable => 0 },
@@ -115,7 +117,7 @@ __PACKAGE__->set_primary_key("id");
 
 =item * L</bin_pkg>
 
-=item * L</arch_id>
+=item * L</arch>
 
 =item * L</ver>
 
@@ -123,21 +125,7 @@ __PACKAGE__->set_primary_key("id");
 
 =cut
 
-__PACKAGE__->add_unique_constraint("bin_ver_bin_pkg_id_arch_idx", ["bin_pkg", "arch_id", "ver"]);
-
-=head2 C<bin_ver_src_ver_id_arch_idx>
-
-=over 4
-
-=item * L</src_ver_id>
-
-=item * L</arch_id>
-
-=back
-
-=cut
-
-__PACKAGE__->add_unique_constraint("bin_ver_src_ver_id_arch_idx", ["src_ver_id", "arch_id"]);
+__PACKAGE__->add_unique_constraint("bin_ver_bin_pkg_id_arch_idx", ["bin_pkg", "arch", "ver"]);
 
 =head1 RELATIONS
 
@@ -152,8 +140,8 @@ Related object: L<Debbugs::DB::Result::Arch>
 __PACKAGE__->belongs_to(
   "arch",
   "Debbugs::DB::Result::Arch",
-  { id => "arch_id" },
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+  { id => "arch" },
+  { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
 =head2 bin_associations
@@ -183,7 +171,7 @@ __PACKAGE__->belongs_to(
   "bin_pkg",
   "Debbugs::DB::Result::BinPkg",
   { id => "bin_pkg" },
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+  { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
 =head2 src_ver
@@ -197,14 +185,24 @@ Related object: L<Debbugs::DB::Result::SrcVer>
 __PACKAGE__->belongs_to(
   "src_ver",
   "Debbugs::DB::Result::SrcVer",
-  { id => "src_ver_id" },
-  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+  { id => "src_ver" },
+  { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-27 18:54:20
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3K+5M1Rohq6AB4uLnVco+w
+# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-11-24 09:08:27
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DzTzZbPkilT8WMhXoZv9xw
+
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    for my $idx (qw(ver bin_pkg src_ver)) {
+       $sqlt_table->add_index(name => 'bin_ver_'.$idx.'_id_idx',
+                              fields => [$idx]);
+    }
+    $sqlt_table->add_index(name => 'bin_ver_src_ver_id_arch_idx',
+                          fields => [qw(src_ver arch)]
+                         );
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;