]> git.donarmstrong.com Git - debbugs.git/commitdiff
Add id to bug_ver and some more indices
authorDon Armstrong <don@donarmstrong.com>
Mon, 25 Nov 2013 01:15:39 +0000 (17:15 -0800)
committerDon Armstrong <don@donarmstrong.com>
Mon, 25 Nov 2013 01:15:39 +0000 (17:15 -0800)
Debbugs/DB/Result/BugVer.pm
Debbugs/DB/Result/Correspondent.pm
Debbugs/DB/Result/Maintainer.pm
Debbugs/DB/Result/Severity.pm
sql/debbugs_schema.sql

index 9d810e9f54d896a4c7ed161ecd91eff3265e74bf..124d185e60bfae96af7f964db6d36527a79e869a 100644 (file)
@@ -35,6 +35,15 @@ __PACKAGE__->table("bug_ver");
 
 =head1 ACCESSORS
 
+=head2 id
+
+  data_type: 'integer'
+  is_auto_increment: 1
+  is_nullable: 0
+  sequence: 'bug_ver_id_seq'
+
+Bug version id
+
 =head2 bug
 
   data_type: 'integer'
@@ -95,6 +104,13 @@ Time that this entry was modified
 =cut
 
 __PACKAGE__->add_columns(
+  "id",
+  {
+    data_type         => "integer",
+    is_auto_increment => 1,
+    is_nullable       => 0,
+    sequence          => "bug_ver_id_seq",
+  },
   "bug",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
   "ver_string",
@@ -121,6 +137,18 @@ __PACKAGE__->add_columns(
   },
 );
 
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
 =head1 UNIQUE CONSTRAINTS
 
 =head2 C<bug_ver_bug_ver_string_found_idx>
@@ -200,8 +228,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07036 @ 2013-11-21 21:57:41
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Yfu0BNTuEb3naSH/RR0YZA
+# Created by DBIx::Class::Schema::Loader v0.07036 @ 2013-11-23 17:31:18
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yTXx9otJq7Ur+tbswRs8mQ
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
index 8646464d61c520828aad090fb0e81d5af94ce461..2bf83f93f0496b2000251485c142d2a470c020bb 100644 (file)
@@ -79,7 +79,7 @@ __PACKAGE__->set_primary_key("id");
 
 =head1 UNIQUE CONSTRAINTS
 
-=head2 C<correspondent_addr_key>
+=head2 C<correspondent_addr_idx>
 
 =over 4
 
@@ -89,7 +89,7 @@ __PACKAGE__->set_primary_key("id");
 
 =cut
 
-__PACKAGE__->add_unique_constraint("correspondent_addr_key", ["addr"]);
+__PACKAGE__->add_unique_constraint("correspondent_addr_idx", ["addr"]);
 
 =head1 RELATIONS
 
@@ -184,8 +184,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07036 @ 2013-10-09 20:27:54
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Wyisfi/87NgArvWis4/tuw
+# Created by DBIx::Class::Schema::Loader v0.07036 @ 2013-11-23 17:31:18
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iw5Rey49aurBMhqdnlKaiw
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
index 801b19f95692e626c9a28e3bf0b0baaf81de0f21..a15e55cca923d1d0ddf10acdde4bbeda1b59e038 100644 (file)
@@ -121,7 +121,7 @@ __PACKAGE__->set_primary_key("id");
 
 =head1 UNIQUE CONSTRAINTS
 
-=head2 C<maintainer_name_key>
+=head2 C<maintainer_name_idx>
 
 =over 4
 
@@ -131,7 +131,7 @@ __PACKAGE__->set_primary_key("id");
 
 =cut
 
-__PACKAGE__->add_unique_constraint("maintainer_name_key", ["name"]);
+__PACKAGE__->add_unique_constraint("maintainer_name_idx", ["name"]);
 
 =head1 RELATIONS
 
@@ -166,8 +166,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07036 @ 2013-11-21 21:57:41
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E1iNr1IKDcHDQYtmVdsoHA
+# Created by DBIx::Class::Schema::Loader v0.07036 @ 2013-11-23 17:31:18
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5E4fT7G2x7wdPfr7SMqgGg
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
index 5a50252e1fe6c109cdafd54949a51ca7b1dc0ae3..34366e36c32eee34693bfdb1de1bf1f7eec60209 100644 (file)
@@ -109,7 +109,7 @@ __PACKAGE__->set_primary_key("id");
 
 =head1 UNIQUE CONSTRAINTS
 
-=head2 C<severity_severity_key>
+=head2 C<severity_severity_idx>
 
 =over 4
 
@@ -119,7 +119,7 @@ __PACKAGE__->set_primary_key("id");
 
 =cut
 
-__PACKAGE__->add_unique_constraint("severity_severity_key", ["severity"]);
+__PACKAGE__->add_unique_constraint("severity_severity_idx", ["severity"]);
 
 =head1 RELATIONS
 
@@ -139,8 +139,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-27 19:35:10
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SVJ20W+hu/tjDthRG38xtA
+# Created by DBIx::Class::Schema::Loader v0.07036 @ 2013-11-23 17:31:18
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xZN34NjFy5iDRay5w6JYVQ
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
index 8b126bd0ea662b403a831d1b22e62ab0bf2e5858..e1e06287859024f375b6b797bd48ee87d6c25b68 100644 (file)
@@ -212,6 +212,7 @@ INSERT INTO column_comments VALUES ('src_ver','based_on','Source package version
 
 
 CREATE TABLE bug_ver (
+       id SERIAL PRIMARY KEY,
        bug INT NOT NULL REFERENCES bug
          ON UPDATE CASCADE ON DELETE RESTRICT,
        ver_string TEXT,
@@ -228,6 +229,7 @@ CREATE INDEX bug_ver_src_pkg_id_src_ver_id_idx ON bug_ver(src_pkg,src_ver);
 CREATE INDEX bug_ver_src_ver_id_idx ON bug_ver(src_ver);
 CREATE UNIQUE INDEX ON bug_ver(bug,ver_string,found);
 INSERT INTO table_comments VALUES ('bug_ver','Bug versions');
+INSERT INTO column_comments VALUES ('bug_ver','id','Bug version id');
 INSERT INTO column_comments VALUES ('bug_ver','bug','Bug number');
 INSERT INTO column_comments VALUES ('bug_ver','ver_string','Version string');
 INSERT INTO column_comments VALUES ('bug_ver','src_pkg','Source package id (matches src_pkg table)');
@@ -430,7 +432,6 @@ INSERT INTO column_comments VALUES ('message','sent_date','Time/date message was
 INSERT INTO column_comments VALUES ('message','refs','Contents of References: header');
 INSERT INTO column_comments VALUES ('message','spam_score','Spam score from spamassassin');
 INSERT INTO column_comments VALUES ('message','is_spam','True if this message was spam and should not be shown');
-
 CREATE INDEX ON message(msgid);
 
 CREATE TABLE message_refs (
@@ -491,6 +492,8 @@ CREATE TABLE bug_message (
        bug_log_offset INT,
        offset_valid TIMESTAMP WITH TIME ZONE
 );
+CREATE UNIQUE INDEX bug_message(bug,message);
+CREATE INDEX bug_message(bug,message_number);
 INSERT INTO table_comments VALUES ('bug_mesage','Mapping between a bug and a message');
 INSERT INTO column_comments VALUES ('bug_message','bug','Bug id (matches bug)');
 INSERT INTO column_comments VALUES ('bug_message','message','Message id (matches message)');