]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB/Result/BinVer.pm
update result classes for new relationships
[debbugs.git] / Debbugs / DB / Result / BinVer.pm
index 432cbb1b773ba01213ccaba0737042327b3e58b9..688b7fe0713f9f977f26c0ecbbdf93bd584b7da0 100644 (file)
@@ -6,7 +6,7 @@ package Debbugs::DB::Result::BinVer;
 
 =head1 NAME
 
-Debbugs::DB::Result::BinVer
+Debbugs::DB::Result::BinVer - Binary versions
 
 =cut
 
@@ -35,57 +35,95 @@ __PACKAGE__->table("bin_ver");
 
 =head1 ACCESSORS
 
-=head2 bin_pkg_id
+=head2 id
+
+  data_type: 'integer'
+  is_auto_increment: 1
+  is_nullable: 0
+  sequence: 'bin_ver_id_seq'
+
+Binary version id
+
+=head2 bin_pkg
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 0
 
+Binary package id (matches bin_pkg)
+
 =head2 src_ver_id
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 0
 
+Source version (matchines src_ver)
+
 =head2 arch_id
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 0
 
+Architecture id (matches arch)
+
 =head2 ver
 
-  data_type: 'text'
+  data_type: 'debversion'
   is_nullable: 0
 
+Binary version
+
 =cut
 
 __PACKAGE__->add_columns(
-  "bin_pkg_id",
+  "id",
+  {
+    data_type         => "integer",
+    is_auto_increment => 1,
+    is_nullable       => 0,
+    sequence          => "bin_ver_id_seq",
+  },
+  "bin_pkg",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "src_ver_id",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "arch_id",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "ver",
-  { data_type => "text", is_nullable => 0 },
+  { data_type => "debversion", is_nullable => 0 },
 );
 
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
 =head1 UNIQUE CONSTRAINTS
 
 =head2 C<bin_ver_bin_pkg_id_arch_idx>
 
 =over 4
 
-=item * L</bin_pkg_id>
+=item * L</bin_pkg>
 
 =item * L</arch_id>
 
+=item * L</ver>
+
 =back
 
 =cut
 
-__PACKAGE__->add_unique_constraint("bin_ver_bin_pkg_id_arch_idx", ["bin_pkg_id", "arch_id"]);
+__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>
 
@@ -118,6 +156,21 @@ __PACKAGE__->belongs_to(
   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
+=head2 bin_associations
+
+Type: has_many
+
+Related object: L<Debbugs::DB::Result::BinAssociation>
+
+=cut
+
+__PACKAGE__->has_many(
+  "bin_associations",
+  "Debbugs::DB::Result::BinAssociation",
+  { "foreign.bin" => "self.id" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 bin_pkg
 
 Type: belongs_to
@@ -129,7 +182,7 @@ Related object: L<Debbugs::DB::Result::BinPkg>
 __PACKAGE__->belongs_to(
   "bin_pkg",
   "Debbugs::DB::Result::BinPkg",
-  { id => "bin_pkg_id" },
+  { id => "bin_pkg" },
   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
@@ -149,8 +202,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-07-17 10:25:29
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0AnavpmoUrdrgChtyIBRBg
+# 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
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration