]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/DB/Result/Maintainer.pm
Update DB Schema version to 6
[debbugs.git] / Debbugs / DB / Result / Maintainer.pm
index 699378983a3b95edb2ea59d4a2397529443676e8..d8c04ec8660c94ae5294e383090bee24c3394abd 100644 (file)
@@ -6,7 +6,7 @@ package Debbugs::DB::Result::Maintainer;
 
 =head1 NAME
 
-Debbugs::DB::Result::Maintainer
+Debbugs::DB::Result::Maintainer - Package maintainer names
 
 =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<maintainer>
 
@@ -42,11 +44,23 @@ __PACKAGE__->table("maintainer");
   is_nullable: 0
   sequence: 'maintainer_id_seq'
 
+Package maintainer id
+
 =head2 name
 
   data_type: 'text'
   is_nullable: 0
 
+Name of package maintainer
+
+=head2 correspondent
+
+  data_type: 'integer'
+  is_foreign_key: 1
+  is_nullable: 0
+
+Correspondent ID
+
 =head2 created
 
   data_type: 'timestamp with time zone'
@@ -54,6 +68,8 @@ __PACKAGE__->table("maintainer");
   is_nullable: 0
   original: {default_value => \"now()"}
 
+Time maintainer record created
+
 =head2 modified
 
   data_type: 'timestamp with time zone'
@@ -61,6 +77,8 @@ __PACKAGE__->table("maintainer");
   is_nullable: 0
   original: {default_value => \"now()"}
 
+Time maintainer record modified
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -73,6 +91,8 @@ __PACKAGE__->add_columns(
   },
   "name",
   { data_type => "text", is_nullable => 0 },
+  "correspondent",
+  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "created",
   {
     data_type     => "timestamp with time zone",
@@ -103,7 +123,7 @@ __PACKAGE__->set_primary_key("id");
 
 =head1 UNIQUE CONSTRAINTS
 
-=head2 C<maintainer_name_key>
+=head2 C<maintainer_name_idx>
 
 =over 4
 
@@ -113,10 +133,25 @@ __PACKAGE__->set_primary_key("id");
 
 =cut
 
-__PACKAGE__->add_unique_constraint("maintainer_name_key", ["name"]);
+__PACKAGE__->add_unique_constraint("maintainer_name_idx", ["name"]);
 
 =head1 RELATIONS
 
+=head2 correspondent
+
+Type: belongs_to
+
+Related object: L<Debbugs::DB::Result::Correspondent>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "correspondent",
+  "Debbugs::DB::Result::Correspondent",
+  { id => "correspondent" },
+  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
+);
+
 =head2 src_vers
 
 Type: has_many
@@ -128,14 +163,19 @@ Related object: L<Debbugs::DB::Result::SrcVer>
 __PACKAGE__->has_many(
   "src_vers",
   "Debbugs::DB::Result::SrcVer",
-  { "foreign.maintainer_id" => "self.id" },
+  { "foreign.maintainer" => "self.id" },
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XOB1oEoov4hXMzTD4A7KHg
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-11-30 21:56:51
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rkpgeXltH2wiC1Us7FIijw
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    $sqlt_table->add_index(name => 'maintainer_idx_correspondent',
+                          fields => [qw(correspondent)],
+                         );
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;