From: Don Armstrong Date: Tue, 26 Mar 2013 01:44:46 +0000 (-0700) Subject: Switch to severity table X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=4a230a0fc6896db591e7dbd9402d317c86e112fd Switch to severity table Add more links into the correspondent table so we can show all a persons bugs together stop using _id Add correspondent full name --- diff --git a/Debbugs/DB/Result/BinPkg.pm b/Debbugs/DB/Result/BinPkg.pm index 985047f..7b007b4 100644 --- a/Debbugs/DB/Result/BinPkg.pm +++ b/Debbugs/DB/Result/BinPkg.pm @@ -104,7 +104,7 @@ Related object: L __PACKAGE__->has_many( "bin_vers", "Debbugs::DB::Result::BinVer", - { "foreign.bin_pkg_id" => "self.id" }, + { "foreign.bin_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -119,13 +119,13 @@ Related object: L __PACKAGE__->has_many( "bug_binpackages", "Debbugs::DB::Result::BugBinpackage", - { "foreign.bin_pkg_id" => "self.id" }, + { "foreign.bin_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MZd5wB+mftx5babS8sAOFQ +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1oGi5SVSzjSxaUmwZBtogw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BinVer.pm b/Debbugs/DB/Result/BinVer.pm index 8966d3d..ec98991 100644 --- a/Debbugs/DB/Result/BinVer.pm +++ b/Debbugs/DB/Result/BinVer.pm @@ -44,7 +44,7 @@ __PACKAGE__->table("bin_ver"); Binary version id -=head2 bin_pkg_id +=head2 bin_pkg data_type: 'integer' is_foreign_key: 1 @@ -85,7 +85,7 @@ __PACKAGE__->add_columns( is_nullable => 0, sequence => "bin_ver_id_seq", }, - "bin_pkg_id", + "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 }, @@ -113,7 +113,7 @@ __PACKAGE__->set_primary_key("id"); =over 4 -=item * L +=item * L =item * L @@ -123,10 +123,7 @@ __PACKAGE__->set_primary_key("id"); =cut -__PACKAGE__->add_unique_constraint( - "bin_ver_bin_pkg_id_arch_idx", - ["bin_pkg_id", "arch_id", "ver"], -); +__PACKAGE__->add_unique_constraint("bin_ver_bin_pkg_id_arch_idx", ["bin_pkg", "arch_id", "ver"]); =head2 C @@ -185,7 +182,7 @@ Related object: L __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" }, ); @@ -205,8 +202,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9iEDj8DfMh5jdc03zs4UmQ +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7Ff81rK1vte+lYz15XofpA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/Bug.pm b/Debbugs/DB/Result/Bug.pm index 5067312..7cab97f 100644 --- a/Debbugs/DB/Result/Bug.pm +++ b/Debbugs/DB/Result/Bug.pm @@ -147,15 +147,6 @@ Individual who submitted this bug; empty if there is no submitter Package name if the package is not known -=head2 severity - - data_type: 'enum' - default_value: 'normal' - extra: {custom_type_name => "bug_severity",list => ["wishlist","minor","normal","important","serious","grave","critical"]} - is_nullable: 1 - -Bug severity - =cut __PACKAGE__->add_columns( @@ -202,24 +193,6 @@ __PACKAGE__->add_columns( { data_type => "text", default_value => "", is_nullable => 0 }, "unknown_packages", { data_type => "text", default_value => "", is_nullable => 0 }, - "severity", - { - data_type => "enum", - default_value => "normal", - extra => { - custom_type_name => "bug_severity", - list => [ - "wishlist", - "minor", - "normal", - "important", - "serious", - "grave", - "critical", - ], - }, - is_nullable => 1, - }, ); =head1 PRIMARY KEY @@ -247,7 +220,7 @@ Related object: L __PACKAGE__->has_many( "bug_binpackages", "Debbugs::DB::Result::BugBinpackage", - { "foreign.bug_id" => "self.id" }, + { "foreign.bug" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -277,7 +250,7 @@ Related object: L __PACKAGE__->has_many( "bug_blocks_bugs", "Debbugs::DB::Result::BugBlock", - { "foreign.bug_id" => "self.id" }, + { "foreign.bug" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -292,7 +265,7 @@ Related object: L __PACKAGE__->has_many( "bug_merged_bugs", "Debbugs::DB::Result::BugMerged", - { "foreign.bug_id" => "self.id" }, + { "foreign.bug" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -311,6 +284,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 bug_severity + +Type: might_have + +Related object: L + +=cut + +__PACKAGE__->might_have( + "bug_severity", + "Debbugs::DB::Result::BugSeverity", + { "foreign.bug" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 bug_srcpackages Type: has_many @@ -322,7 +310,22 @@ Related object: L __PACKAGE__->has_many( "bug_srcpackages", "Debbugs::DB::Result::BugSrcpackage", - { "foreign.bug_id" => "self.id" }, + { "foreign.bug" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 bug_submitters + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bug_submitters", + "Debbugs::DB::Result::BugSubmitter", + { "foreign.bug" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -337,7 +340,7 @@ Related object: L __PACKAGE__->has_many( "bug_tags", "Debbugs::DB::Result::BugTag", - { "foreign.bug_id" => "self.id" }, + { "foreign.bug" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -352,7 +355,22 @@ Related object: L __PACKAGE__->has_many( "bug_vers", "Debbugs::DB::Result::BugVer", - { "foreign.bug_id" => "self.id" }, + { "foreign.bug" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 bugs_done_by + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bugs_done_by", + "Debbugs::DB::Result::BugDoneBy", + { "foreign.bug" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -372,8 +390,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-22 16:20:31 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Cvwpg/d7shs9bxFOQZhNVg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cPIz8V6KUWZip+5Dvi7+4Q # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugBinpackage.pm b/Debbugs/DB/Result/BugBinpackage.pm index f63025a..4f0a1ba 100644 --- a/Debbugs/DB/Result/BugBinpackage.pm +++ b/Debbugs/DB/Result/BugBinpackage.pm @@ -35,7 +35,14 @@ __PACKAGE__->table("bug_binpackage"); =head1 ACCESSORS -=head2 bug_id +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bug_binpackage_id_seq' + +=head2 bug data_type: 'integer' is_foreign_key: 1 @@ -43,7 +50,7 @@ __PACKAGE__->table("bug_binpackage"); Bug id (matches bug) -=head2 bin_pkg_id +=head2 bin_pkg data_type: 'integer' is_foreign_key: 1 @@ -54,27 +61,46 @@ Binary package id (matches bin_pkg) =cut __PACKAGE__->add_columns( - "bug_id", + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bug_binpackage_id_seq", + }, + "bug", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, - "bin_pkg_id", + "bin_pkg", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 UNIQUE CONSTRAINTS =head2 C =over 4 -=item * L +=item * L -=item * L +=item * L =back =cut -__PACKAGE__->add_unique_constraint("bug_binpackage_id_pkg_id", ["bug_id", "bin_pkg_id"]); +__PACKAGE__->add_unique_constraint("bug_binpackage_id_pkg_id", ["bug", "bin_pkg"]); =head1 RELATIONS @@ -89,7 +115,7 @@ Related object: L __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" }, ); @@ -104,13 +130,13 @@ Related object: L __PACKAGE__->belongs_to( "bug", "Debbugs::DB::Result::Bug", - { id => "bug_id" }, + { id => "bug" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2QtRdBjEVaUYmfqY7rWA6g +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kfOppT635GeL9tvBVm6VNA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugBlock.pm b/Debbugs/DB/Result/BugBlock.pm index 061b9ab..e6f8d30 100644 --- a/Debbugs/DB/Result/BugBlock.pm +++ b/Debbugs/DB/Result/BugBlock.pm @@ -35,7 +35,14 @@ __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 @@ -49,24 +56,43 @@ Bug number is_foreign_key: 1 is_nullable: 0 -Bug number which is blocked by bug_id +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 + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 UNIQUE CONSTRAINTS =head2 C =over 4 -=item * L +=item * L =item * L @@ -74,7 +100,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 @@ -104,13 +130,13 @@ Related object: L __PACKAGE__->belongs_to( "bug", "Debbugs::DB::Result::Bug", - { id => "bug_id" }, + { id => "bug" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-29 18:11:35 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WLr8TlnQMEVUj2maG0WFCw +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KMeb2Z3p/g1ihuTwbl2R7w # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugDoneBy.pm b/Debbugs/DB/Result/BugDoneBy.pm new file mode 100644 index 0000000..5fb6e6d --- /dev/null +++ b/Debbugs/DB/Result/BugDoneBy.pm @@ -0,0 +1,145 @@ +use utf8; +package Debbugs::DB::Result::BugDoneBy; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Debbugs::DB::Result::BugDoneBy - Correspondent who finished this bug (emailed -done) + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("bug_done_by"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bug_done_by_id_seq' + +Bug Done By ID + +=head2 bug + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Bug number which was done + +=head2 done_by + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Bug finisher (connects to correspondent) + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bug_done_by_id_seq", + }, + "bug", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "done_by", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("bug_done_by_bug_done_by_idx", ["bug", "done_by"]); + +=head1 RELATIONS + +=head2 bug + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "bug", + "Debbugs::DB::Result::Bug", + { id => "bug" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 done_by + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "done_by", + "Debbugs::DB::Result::Correspondent", + { id => "done_by" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CBqbxeroNjyMIoDmjnAlbw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Debbugs/DB/Result/BugMerged.pm b/Debbugs/DB/Result/BugMerged.pm index dce877c..881136d 100644 --- a/Debbugs/DB/Result/BugMerged.pm +++ b/Debbugs/DB/Result/BugMerged.pm @@ -35,7 +35,14 @@ __PACKAGE__->table("bug_merged"); =head1 ACCESSORS -=head2 bug_id +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bug_merged_id_seq' + +=head2 bug data_type: 'integer' is_foreign_key: 1 @@ -49,24 +56,43 @@ Bug number is_foreign_key: 1 is_nullable: 0 -Bug number which is merged with bug_id +Bug number which is merged with bug =cut __PACKAGE__->add_columns( - "bug_id", + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bug_merged_id_seq", + }, + "bug", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "merged", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 UNIQUE CONSTRAINTS =head2 C =over 4 -=item * L +=item * L =item * L @@ -74,7 +100,7 @@ __PACKAGE__->add_columns( =cut -__PACKAGE__->add_unique_constraint("bug_merged_bug_id_merged_idx", ["bug_id", "merged"]); +__PACKAGE__->add_unique_constraint("bug_merged_bug_id_merged_idx", ["bug", "merged"]); =head1 RELATIONS @@ -89,7 +115,7 @@ Related object: L __PACKAGE__->belongs_to( "bug", "Debbugs::DB::Result::Bug", - { id => "bug_id" }, + { id => "bug" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); @@ -109,8 +135,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-29 18:11:35 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hgozwwtpX5QCWb1FgIgIlw +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:We33XZGYf3rBQO/xmfEOrg # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugMessage.pm b/Debbugs/DB/Result/BugMessage.pm index d30b445..07a4351 100644 --- a/Debbugs/DB/Result/BugMessage.pm +++ b/Debbugs/DB/Result/BugMessage.pm @@ -35,6 +35,13 @@ __PACKAGE__->table("bug_message"); =head1 ACCESSORS +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bug_message_id_seq' + =head2 bug data_type: 'integer' @@ -75,6 +82,13 @@ Time offset was valid =cut __PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bug_message_id_seq", + }, "bug", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "message", @@ -87,6 +101,18 @@ __PACKAGE__->add_columns( { data_type => "timestamp with time zone", is_nullable => 1 }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 RELATIONS =head2 bug @@ -120,8 +146,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WkrYUE1iE8o3fFkzQSkzeQ +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-22 21:34:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:v1hxqbRZsqjnYYqfKnuNug # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugPackage.pm b/Debbugs/DB/Result/BugPackage.pm index 2d85e1d..27bdfd4 100644 --- a/Debbugs/DB/Result/BugPackage.pm +++ b/Debbugs/DB/Result/BugPackage.pm @@ -35,7 +35,7 @@ __PACKAGE__->table("bug_package"); =head1 ACCESSORS -=head2 bug_id +=head2 bug data_type: 'integer' is_nullable: 1 @@ -58,7 +58,7 @@ __PACKAGE__->table("bug_package"); =cut __PACKAGE__->add_columns( - "bug_id", + "bug", { data_type => "integer", is_nullable => 1 }, "pkg_id", { data_type => "integer", is_nullable => 1 }, @@ -69,8 +69,8 @@ __PACKAGE__->add_columns( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-07-17 21:09:18 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4ELLjuEEq63Ca0PeqFEfsg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z0ytKzfSK0huQAZwrklLUA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugSeverity.pm b/Debbugs/DB/Result/BugSeverity.pm new file mode 100644 index 0000000..c2e39d0 --- /dev/null +++ b/Debbugs/DB/Result/BugSeverity.pm @@ -0,0 +1,113 @@ +use utf8; +package Debbugs::DB::Result::BugSeverity; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Debbugs::DB::Result::BugSeverity - Bug <-> tag mapping + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("bug_severity"); + +=head1 ACCESSORS + +=head2 bug + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Bug id (matches bug) + +=head2 severity_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Severity id (matches severity) + +=cut + +__PACKAGE__->add_columns( + "bug", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "severity_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("bug"); + +=head1 RELATIONS + +=head2 bug + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "bug", + "Debbugs::DB::Result::Bug", + { id => "bug" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 severity + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "severity", + "Debbugs::DB::Result::Severity", + { id => "severity_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LOIST37qyS/Mh96uRH7ZcQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Debbugs/DB/Result/BugSrcpackage.pm b/Debbugs/DB/Result/BugSrcpackage.pm index 4c07d98..b74fa4c 100644 --- a/Debbugs/DB/Result/BugSrcpackage.pm +++ b/Debbugs/DB/Result/BugSrcpackage.pm @@ -35,7 +35,14 @@ __PACKAGE__->table("bug_srcpackage"); =head1 ACCESSORS -=head2 bug_id +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bug_srcpackage_id_seq' + +=head2 bug data_type: 'integer' is_foreign_key: 1 @@ -43,7 +50,7 @@ __PACKAGE__->table("bug_srcpackage"); Bug id (matches bug) -=head2 src_pkg_id +=head2 src_pkg data_type: 'integer' is_foreign_key: 1 @@ -54,27 +61,46 @@ Source package id (matches src_pkg) =cut __PACKAGE__->add_columns( - "bug_id", + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bug_srcpackage_id_seq", + }, + "bug", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, - "src_pkg_id", + "src_pkg", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 UNIQUE CONSTRAINTS =head2 C =over 4 -=item * L +=item * L -=item * L +=item * L =back =cut -__PACKAGE__->add_unique_constraint("bug_srcpackage_id_pkg_id", ["bug_id", "src_pkg_id"]); +__PACKAGE__->add_unique_constraint("bug_srcpackage_id_pkg_id", ["bug", "src_pkg"]); =head1 RELATIONS @@ -89,7 +115,7 @@ Related object: L __PACKAGE__->belongs_to( "bug", "Debbugs::DB::Result::Bug", - { id => "bug_id" }, + { id => "bug" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); @@ -104,13 +130,13 @@ Related object: L __PACKAGE__->belongs_to( "src_pkg", "Debbugs::DB::Result::SrcPkg", - { id => "src_pkg_id" }, + { id => "src_pkg" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k8ZDk5IbnGWbhwRJ17dNXA +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:afOJNl3BAD0xSo41IyTJZA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugSubmitter.pm b/Debbugs/DB/Result/BugSubmitter.pm new file mode 100644 index 0000000..b16eb5c --- /dev/null +++ b/Debbugs/DB/Result/BugSubmitter.pm @@ -0,0 +1,145 @@ +use utf8; +package Debbugs::DB::Result::BugSubmitter; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Debbugs::DB::Result::BugSubmitter - Submitter of a bug (connects to correspondent) + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("bug_submitter"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bug_submitter_id_seq' + +Bug Submitter ID + +=head2 bug + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Bug which was submitted by this submitter + +=head2 submitter + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Bug submitter (connects to correspondent) + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bug_submitter_id_seq", + }, + "bug", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "submitter", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("bug_submitter_bug_submitter_idx", ["bug", "submitter"]); + +=head1 RELATIONS + +=head2 bug + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "bug", + "Debbugs::DB::Result::Bug", + { id => "bug" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 submitter + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "submitter", + "Debbugs::DB::Result::Correspondent", + { id => "submitter" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xlPjKuzFWXqJs1TxWZ+YSw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Debbugs/DB/Result/BugTag.pm b/Debbugs/DB/Result/BugTag.pm index 9361bd3..d68a93a 100644 --- a/Debbugs/DB/Result/BugTag.pm +++ b/Debbugs/DB/Result/BugTag.pm @@ -35,7 +35,14 @@ __PACKAGE__->table("bug_tag"); =head1 ACCESSORS -=head2 bug_id +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bug_tag_id_seq' + +=head2 bug data_type: 'integer' is_foreign_key: 1 @@ -54,19 +61,38 @@ Tag id (matches tag) =cut __PACKAGE__->add_columns( - "bug_id", + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bug_tag_id_seq", + }, + "bug", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "tag_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 UNIQUE CONSTRAINTS =head2 C =over 4 -=item * L +=item * L =item * L @@ -74,7 +100,7 @@ __PACKAGE__->add_columns( =cut -__PACKAGE__->add_unique_constraint("bug_tag_bug_tag_id", ["bug_id", "tag_id"]); +__PACKAGE__->add_unique_constraint("bug_tag_bug_tag_id", ["bug", "tag_id"]); =head1 RELATIONS @@ -89,7 +115,7 @@ Related object: L __PACKAGE__->belongs_to( "bug", "Debbugs::DB::Result::Bug", - { id => "bug_id" }, + { id => "bug" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); @@ -109,8 +135,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TJLM6fzZRNQXknUuXE8Pvw +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fGlaYDuI8YCGvA1gY7DNaQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugVer.pm b/Debbugs/DB/Result/BugVer.pm index 42eb1cc..9d2bdcc 100644 --- a/Debbugs/DB/Result/BugVer.pm +++ b/Debbugs/DB/Result/BugVer.pm @@ -35,7 +35,7 @@ __PACKAGE__->table("bug_ver"); =head1 ACCESSORS -=head2 bug_id +=head2 bug data_type: 'integer' is_foreign_key: 1 @@ -50,7 +50,7 @@ Bug number Version string -=head2 src_pkg_id +=head2 src_pkg data_type: 'integer' is_foreign_key: 1 @@ -95,11 +95,11 @@ Time that this entry was modified =cut __PACKAGE__->add_columns( - "bug_id", + "bug", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "ver_string", { data_type => "text", is_nullable => 1 }, - "src_pkg_id", + "src_pkg", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "src_ver_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, @@ -123,11 +123,11 @@ __PACKAGE__->add_columns( =head1 UNIQUE CONSTRAINTS -=head2 C +=head2 C =over 4 -=item * L +=item * L =item * L @@ -138,8 +138,8 @@ __PACKAGE__->add_columns( =cut __PACKAGE__->add_unique_constraint( - "bug_ver_bug_id_ver_string_found_idx", - ["bug_id", "ver_string", "found"], + "bug_ver_bug_ver_string_found_idx", + ["bug", "ver_string", "found"], ); =head1 RELATIONS @@ -155,7 +155,7 @@ Related object: L __PACKAGE__->belongs_to( "bug", "Debbugs::DB::Result::Bug", - { id => "bug_id" }, + { id => "bug" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); @@ -170,7 +170,7 @@ Related object: L __PACKAGE__->belongs_to( "src_pkg", "Debbugs::DB::Result::SrcPkg", - { id => "src_pkg_id" }, + { id => "src_pkg" }, { is_deferrable => 1, join_type => "LEFT", @@ -200,8 +200,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d+zLb/svrH4BgZjZXT+hdg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t2bjlM8I5vRChrNgknwI4g # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/Correspondent.pm b/Debbugs/DB/Result/Correspondent.pm index 857159e..be76b85 100644 --- a/Debbugs/DB/Result/Correspondent.pm +++ b/Debbugs/DB/Result/Correspondent.pm @@ -93,6 +93,51 @@ __PACKAGE__->add_unique_constraint("correspondent_addr_key", ["addr"]); =head1 RELATIONS +=head2 bug_submitters + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bug_submitters", + "Debbugs::DB::Result::BugSubmitter", + { "foreign.submitter" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 bugs_done_by + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bugs_done_by", + "Debbugs::DB::Result::BugDoneBy", + { "foreign.done_by" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 correspondent_full_names + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "correspondent_full_names", + "Debbugs::DB::Result::CorrespondentFullName", + { "foreign.correspondent" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 message_correspondents Type: has_many @@ -109,8 +154,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1oERdaKncROw6eUENGs9aw +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ev/tN0AsOcs7AfC3Iz84dQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/CorrespondentFullName.pm b/Debbugs/DB/Result/CorrespondentFullName.pm new file mode 100644 index 0000000..c137ee5 --- /dev/null +++ b/Debbugs/DB/Result/CorrespondentFullName.pm @@ -0,0 +1,125 @@ +use utf8; +package Debbugs::DB::Result::CorrespondentFullName; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Debbugs::DB::Result::CorrespondentFullName - Full names of BTS correspondents + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("correspondent_full_name"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'correspondent_full_name_id_seq' + +Correspondent full name id + +=head2 correspondent + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 full_name + + data_type: 'text' + is_nullable: 0 + +Correspondent full name (includes e-mail address) + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "correspondent_full_name_id_seq", + }, + "correspondent", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "full_name", + { data_type => "text", is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("correspondent_full_name_full_name_key", ["full_name"]); + +=head1 RELATIONS + +=head2 correspondent + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "correspondent", + "Debbugs::DB::Result::Correspondent", + { id => "correspondent" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U7mn1zcYHvgfaD4arcYAeA + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Debbugs/DB/Result/MessageCorrespondent.pm b/Debbugs/DB/Result/MessageCorrespondent.pm index 033f448..8609117 100644 --- a/Debbugs/DB/Result/MessageCorrespondent.pm +++ b/Debbugs/DB/Result/MessageCorrespondent.pm @@ -35,6 +35,13 @@ __PACKAGE__->table("message_correspondent"); =head1 ACCESSORS +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'message_correspondent_id_seq' + =head2 message data_type: 'integer' @@ -63,6 +70,13 @@ Type of correspondent (to, from, envfrom, cc, etc.) =cut __PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "message_correspondent_id_seq", + }, "message", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "correspondent", @@ -79,6 +93,18 @@ __PACKAGE__->add_columns( }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 UNIQUE CONSTRAINTS =head2 C @@ -133,8 +159,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wo2PGK4VpJ1hB8YBJ9QNUg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-22 21:34:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Fyy71zaVBm59n1blNwJ23w # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/MessageRef.pm b/Debbugs/DB/Result/MessageRef.pm index 5f39e43..a4914d3 100644 --- a/Debbugs/DB/Result/MessageRef.pm +++ b/Debbugs/DB/Result/MessageRef.pm @@ -35,6 +35,13 @@ __PACKAGE__->table("message_refs"); =head1 ACCESSORS +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'message_refs_id_seq' + =head2 message data_type: 'integer' @@ -70,6 +77,13 @@ TRUE if this message->ref came from In-Reply-To: or similar. =cut __PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "message_refs_id_seq", + }, "message", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "refs", @@ -80,6 +94,18 @@ __PACKAGE__->add_columns( { data_type => "boolean", default_value => \"false", is_nullable => 1 }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + =head1 UNIQUE CONSTRAINTS =head2 C @@ -129,8 +155,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-01-22 21:35:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qPL3EsH3iVrcwJKRNVzTEQ +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-22 21:34:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sV72FKvhPxYd6eWvCE4i9Q # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/Severity.pm b/Debbugs/DB/Result/Severity.pm new file mode 100644 index 0000000..a78b676 --- /dev/null +++ b/Debbugs/DB/Result/Severity.pm @@ -0,0 +1,147 @@ +use utf8; +package Debbugs::DB::Result::Severity; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Debbugs::DB::Result::Severity - Bug severity + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("severity"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'severity_id_seq' + +Severity id + +=head2 severity + + data_type: 'text' + is_nullable: 0 + +Severity name + +=head2 ordering + + data_type: 'integer' + default_value: 5 + is_nullable: 0 + +Severity ordering (more severe severities have higher numbers) + +=head2 strong + + data_type: 'boolean' + default_value: false + is_nullable: 1 + +True if severity is a strong severity + +=head2 obsolete + + data_type: 'boolean' + default_value: false + is_nullable: 1 + +Whether a severity level is obsolete (should not be set on new bugs) + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "severity_id_seq", + }, + "severity", + { data_type => "text", is_nullable => 0 }, + "ordering", + { data_type => "integer", default_value => 5, is_nullable => 0 }, + "strong", + { data_type => "boolean", default_value => \"false", is_nullable => 1 }, + "obsolete", + { data_type => "boolean", default_value => \"false", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("severity_severity_key", ["severity"]); + +=head1 RELATIONS + +=head2 bug_severities + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bug_severities", + "Debbugs::DB::Result::BugSeverity", + { "foreign.severity_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-22 23:19:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ofel01VRzkuSKCGAU6hmMg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Debbugs/DB/Result/SrcPkg.pm b/Debbugs/DB/Result/SrcPkg.pm index 01d61f0..ae745c5 100644 --- a/Debbugs/DB/Result/SrcPkg.pm +++ b/Debbugs/DB/Result/SrcPkg.pm @@ -142,7 +142,7 @@ Related object: L __PACKAGE__->has_many( "bug_srcpackages", "Debbugs::DB::Result::BugSrcpackage", - { "foreign.src_pkg_id" => "self.id" }, + { "foreign.src_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -157,7 +157,7 @@ Related object: L __PACKAGE__->has_many( "bug_vers", "Debbugs::DB::Result::BugVer", - { "foreign.src_pkg_id" => "self.id" }, + { "foreign.src_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -187,13 +187,13 @@ Related object: L __PACKAGE__->has_many( "src_vers", "Debbugs::DB::Result::SrcVer", - { "foreign.src_pkg_id" => "self.id" }, + { "foreign.src_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-12-03 15:57:07 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zKfk7AmIYswUAYKBbBGQaQ +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:25A54CF+CL9tRJ6AUDu+FA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/SrcVer.pm b/Debbugs/DB/Result/SrcVer.pm index 2ab36e7..0b86ced 100644 --- a/Debbugs/DB/Result/SrcVer.pm +++ b/Debbugs/DB/Result/SrcVer.pm @@ -44,7 +44,7 @@ __PACKAGE__->table("src_ver"); Source package version id -=head2 src_pkg_id +=head2 src_pkg data_type: 'integer' is_foreign_key: 1 @@ -94,7 +94,7 @@ __PACKAGE__->add_columns( is_nullable => 0, sequence => "src_ver_id_seq", }, - "src_pkg_id", + "src_pkg", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "ver", { data_type => "debversion", is_nullable => 0 }, @@ -129,7 +129,7 @@ __PACKAGE__->set_primary_key("id"); =over 4 -=item * L +=item * L =item * L @@ -137,7 +137,7 @@ __PACKAGE__->set_primary_key("id"); =cut -__PACKAGE__->add_unique_constraint("src_ver_src_pkg_id_ver", ["src_pkg_id", "ver"]); +__PACKAGE__->add_unique_constraint("src_ver_src_pkg_id_ver", ["src_pkg", "ver"]); =head1 RELATIONS @@ -237,7 +237,7 @@ Related object: L __PACKAGE__->belongs_to( "src_pkg", "Debbugs::DB::Result::SrcPkg", - { id => "src_pkg_id" }, + { id => "src_pkg" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); @@ -257,8 +257,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-12-03 15:57:07 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YB4WADgoa3KiJq2OdeSmmQ +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-03-25 18:43:53 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I9bHyZBAJim7KZNk9Yd6Vw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/sql/debbugs_schema.sql b/sql/debbugs_schema.sql index 9fc729a..bedb758 100644 --- a/sql/debbugs_schema.sql +++ b/sql/debbugs_schema.sql @@ -1,8 +1,9 @@ +DROP TABLE bug_severity CASCADE; DROP TABLE bug_tag CASCADE; DROP TABLE tag CASCADE; +DROP TABLE severity CASCADE; DROP TABLE bug CASCADE; -DROP TYPE bug_severity CASCADE; DROP TABLE src_pkg CASCADE; DROP TABLE bug_ver CASCADE; DROP TABLE src_pkg_alias CASCADE; @@ -23,6 +24,9 @@ DROP TABLE src_associations CASCADE; DROP TABLE maintainer CASCADE; DROP TABLE bug_message CASCADE; DROP TABLE message_correspondent CASCADE; +DROP TABLE bug_submitter CASCADE; +DROP TABLE bug_done_by CASCADE; +DROP TABLE correspondent_full_name CASCADE; DROP TABLE correspondent CASCADE; DROP TABLE message_refs CASCADE; DROP TABLE message CASCADE; @@ -43,10 +47,6 @@ CREATE TABLE column_comments ( ); CREATE UNIQUE INDEX ON column_comments(table_name,column_name); --- severities -CREATE TYPE bug_severity AS ENUM ('wishlist','minor','normal', - 'important','serious','grave','critical'); - CREATE TABLE maintainer ( id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE, @@ -74,8 +74,7 @@ CREATE TABLE bug ( done TEXT NOT NULL DEFAULT '', owner TEXT NOT NULL DEFAULT '', submitter TEXT NOT NULL DEFAULT '', - unknown_packages TEXT NOT NULL DEfAULT '', - severity bug_severity DEFAULT 'normal'::bug_severity + unknown_packages TEXT NOT NULL DEfAULT '' ); INSERT INTO table_comments VALUES ('bug','Bugs'); INSERT INTO column_comments VALUES ('bug','id','Bug number'); @@ -92,34 +91,35 @@ INSERT INTO column_comments VALUES ('bug','done','Individual who did the -done; INSERT INTO column_comments VALUES ('bug','owner','Individual who owns this bug; empty if no one owns it'); INSERT INTO column_comments VALUES ('bug','submitter','Individual who submitted this bug; empty if there is no submitter'); INSERT INTO column_comments VALUES ('bug','unknown_packages','Package name if the package is not known'); -INSERT INTO column_comments VALUES ('bug','severity','Bug severity'); CREATE TABLE bug_blocks ( - bug_id INT NOT NULL REFERENCES bug, + id SERIAL PRIMARY KEY, + bug INT NOT NULL REFERENCES bug, blocks INT NOT NULL REFERENCES bug, - CONSTRAINT bug_doesnt_block_itself CHECK (bug_id <> blocks) + CONSTRAINT bug_doesnt_block_itself CHECK (bug <> blocks) ); -CREATE UNIQUE INDEX bug_blocks_bug_id_blocks_idx ON bug_blocks(bug_id,blocks); -CREATE INDEX bug_blocks_bug_id_idx ON bug_blocks(bug_id); +CREATE UNIQUE INDEX bug_blocks_bug_id_blocks_idx ON bug_blocks(bug,blocks); +CREATE INDEX bug_blocks_bug_id_idx ON bug_blocks(bug); CREATE INDEX bug_blocks_blocks_idx ON bug_blocks(blocks); INSERT INTO table_comments VALUES ('bug_blocks','Bugs which block other bugs'); -INSERT INTO column_comments VALUES ('bug_blocks','bug_id','Bug number'); -INSERT INTO column_comments VALUES ('bug_blocks','blocks','Bug number which is blocked by bug_id'); +INSERT INTO column_comments VALUES ('bug_blocks','bug','Bug number'); +INSERT INTO column_comments VALUES ('bug_blocks','blocks','Bug number which is blocked by bug'); CREATE TABLE bug_merged ( - bug_id INT NOT NULL REFERENCES bug, + id SERIAL PRIMARY KEY, + bug INT NOT NULL REFERENCES bug, merged INT NOT NULL REFERENCES bug, - CONSTRAINT bug_doesnt_merged_itself CHECK (bug_id <> merged) + CONSTRAINT bug_doesnt_merged_itself CHECK (bug <> merged) ); -CREATE UNIQUE INDEX bug_merged_bug_id_merged_idx ON bug_merged(bug_id,merged); -CREATE INDEX bug_merged_bug_id_idx ON bug_merged(bug_id); +CREATE UNIQUE INDEX bug_merged_bug_id_merged_idx ON bug_merged(bug,merged); +CREATE INDEX bug_merged_bug_id_idx ON bug_merged(bug); CREATE INDEX bug_merged_merged_idx ON bug_merged(merged); INSERT INTO table_comments VALUES ('bug_merged','Bugs which are merged with other bugs'); -INSERT INTO column_comments VALUES ('bug_merged','bug_id','Bug number'); -INSERT INTO column_comments VALUES ('bug_merged','merged','Bug number which is merged with bug_id'); +INSERT INTO column_comments VALUES ('bug_merged','bug','Bug number'); +INSERT INTO column_comments VALUES ('bug_merged','merged','Bug number which is merged with bug'); CREATE TABLE src_pkg ( id SERIAL PRIMARY KEY, @@ -138,7 +138,7 @@ INSERT INTO column_comments VALUES ('src_pkg','alias_of','Source package id whic CREATE TABLE src_ver ( id SERIAL PRIMARY KEY, - src_pkg_id INT NOT NULL REFERENCES src_pkg + src_pkg INT NOT NULL REFERENCES src_pkg ON UPDATE CASCADE ON DELETE CASCADE, ver public.debversion NOT NULL, maintainer_id INT REFERENCES maintainer @@ -147,10 +147,10 @@ CREATE TABLE src_ver ( based_on INT REFERENCES src_ver ON UPDATE CASCADE ON DELETE CASCADE ); -CREATE UNIQUE INDEX src_ver_src_pkg_id_ver ON src_ver(src_pkg_id,ver); +CREATE UNIQUE INDEX src_ver_src_pkg_id_ver ON src_ver(src_pkg,ver); INSERT INTO table_comments VALUES ('src_ver','Source Package versions'); INSERT INTO column_comments VALUES ('src_ver','id','Source package version id'); -INSERT INTO column_comments VALUES ('src_ver','src_pkg_id','Source package id (matches src_pkg table)'); +INSERT INTO column_comments VALUES ('src_ver','src_pkg','Source package id (matches src_pkg table)'); INSERT INTO column_comments VALUES ('src_ver','ver','Version of the source package'); INSERT INTO column_comments VALUES ('src_ver','maintainer_id','Maintainer id (matches maintainer table)'); INSERT INTO column_comments VALUES ('src_ver','upload_date','Date this version of the source package was uploaded'); @@ -159,10 +159,10 @@ INSERT INTO column_comments VALUES ('src_ver','based_on','Source package version CREATE TABLE bug_ver ( - bug_id INT NOT NULL REFERENCES bug + bug INT NOT NULL REFERENCES bug ON UPDATE CASCADE ON DELETE RESTRICT, ver_string TEXT, - src_pkg_id INT REFERENCES src_pkg + src_pkg INT REFERENCES src_pkg ON UPDATE CASCADE ON DELETE SET NULL, src_ver_id INT REFERENCES src_ver ON UPDATE CASCADE ON DELETE SET NULL, @@ -170,14 +170,14 @@ CREATE TABLE bug_ver ( creation TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), last_modified TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -CREATE INDEX bug_ver_src_pkg_id_idx ON bug_ver(src_pkg_id); -CREATE INDEX bug_ver_src_pkg_id_src_ver_id_idx ON bug_ver(src_pkg_id,src_ver_id); +CREATE INDEX bug_ver_src_pkg_id_idx ON bug_ver(src_pkg); +CREATE INDEX bug_ver_src_pkg_id_src_ver_id_idx ON bug_ver(src_pkg,src_ver_id); CREATE INDEX bug_ver_src_ver_id_idx ON bug_ver(src_ver_id); -CREATE UNIQUE INDEX ON bug_ver(bug_id,ver_string,found); +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','bug_id','Bug number'); +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_id','Source package id (matches src_pkg table)'); +INSERT INTO column_comments VALUES ('bug_ver','src_pkg','Source package id (matches src_pkg table)'); INSERT INTO column_comments VALUES ('bug_ver','src_ver_id','Source package version id (matches src_ver table)'); INSERT INTO column_comments VALUES ('bug_ver','found','True if this is a found version; false if this is a fixed version'); INSERT INTO column_comments VALUES ('bug_ver','creation','Time that this entry was created'); @@ -204,7 +204,7 @@ INSERT INTO column_comments VALUES ('bin_pkg','pkg','Binary package name'); CREATE TABLE bin_ver( id SERIAL PRIMARY KEY, - bin_pkg_id INT NOT NULL REFERENCES bin_pkg + bin_pkg INT NOT NULL REFERENCES bin_pkg ON UPDATE CASCADE ON DELETE CASCADE, src_ver_id INT NOT NULL REFERENCES src_ver ON UPDATE CASCADE ON DELETE CASCADE, @@ -213,13 +213,13 @@ CREATE TABLE bin_ver( ver public.debversion NOT NULL ); CREATE INDEX bin_ver_ver_idx ON bin_ver(ver); -CREATE UNIQUE INDEX bin_ver_bin_pkg_id_arch_idx ON bin_ver(bin_pkg_id,arch_id,ver); +CREATE UNIQUE INDEX bin_ver_bin_pkg_id_arch_idx ON bin_ver(bin_pkg,arch_id,ver); CREATE UNIQUE INDEX bin_ver_src_ver_id_arch_idx ON bin_ver(src_ver_id,arch_id); -CREATE INDEX bin_ver_bin_pkg_id_idx ON bin_ver(bin_pkg_id); +CREATE INDEX bin_ver_bin_pkg_id_idx ON bin_ver(bin_pkg); CREATE INDEX bin_ver_src_ver_id_idx ON bin_ver(src_ver_id); INSERT INTO table_comments VALUES ('bin_ver','Binary versions'); INSERT INTO column_comments VALUES ('bin_ver','id','Binary version id'); -INSERT INTO column_comments VALUES ('bin_ver','bin_pkg_id','Binary package id (matches bin_pkg)'); +INSERT INTO column_comments VALUES ('bin_ver','bin_pkg','Binary package id (matches bin_pkg)'); INSERT INTO column_comments VALUES ('bin_ver','src_ver_id','Source version (matchines src_ver)'); INSERT INTO column_comments VALUES ('bin_ver','arch_id','Architecture id (matches arch)'); INSERT INTO column_comments VALUES ('bin_ver','ver','Binary version'); @@ -234,50 +234,75 @@ INSERT INTO column_comments VALUES ('tag','id','Tag id'); INSERT INTO column_comments VALUES ('tag','tag','Tag name'); INSERT INTO column_comments VALUES ('tag','obsolete','Whether a tag is obsolete (should not be set on new bugs)'); - CREATE TABLE bug_tag ( - bug_id INT NOT NULL REFERENCES bug, + id SERIAL PRIMARY KEY, + bug INT NOT NULL REFERENCES bug, tag_id INT NOT NULL REFERENCES tag ); INSERT INTO table_comments VALUES ('bug_tag','Bug <-> tag mapping'); -INSERT INTO column_comments VALUES ('bug_tag','bug_id','Bug id (matches bug)'); +INSERT INTO column_comments VALUES ('bug_tag','bug','Bug id (matches bug)'); INSERT INTO column_comments VALUES ('bug_tag','tag_id','Tag id (matches tag)'); -CREATE UNIQUE INDEX bug_tag_bug_tag_id ON bug_tag (bug_id,tag_id); +CREATE UNIQUE INDEX bug_tag_bug_tag_id ON bug_tag (bug,tag_id); CREATE INDEX bug_tag_tag_id ON bug_tag (tag_id); -CREATE INDEX bug_tag_bug_id ON bug_tag (bug_id); +CREATE INDEX bug_tag_bug_id ON bug_tag (bug); + + +CREATE TABLE severity ( + id SERIAL PRIMARY KEY, + severity TEXT NOT NULL UNIQUE, + ordering INT NOT NULL DEFAULT 5, + strong BOOLEAN DEFAULT FALSE, + obsolete BOOLEAN DEFAULT FALSE +); +INSERT INTO table_comments VALUES ('severity','Bug severity'); +INSERT INTO column_comments VALUES ('severity','id','Severity id'); +INSERT INTO column_comments VALUES ('severity','severity','Severity name'); +INSERT INTO column_comments VALUES ('severity','ordering','Severity ordering (more severe severities have higher numbers)'); +INSERT INTO column_comments VALUES ('severity','strong','True if severity is a strong severity'); +INSERT INTO column_comments VALUES ('severity','obsolete','Whether a severity level is obsolete (should not be set on new bugs)'); + +CREATE TABLE bug_severity( + bug INT PRIMARY KEY REFERENCES bug, + severity_id INT NOT NULL REFERENCES severity +); +INSERT INTO table_comments VALUES ('bug_severity','Bug <-> tag mapping'); +INSERT INTO column_comments VALUES ('bug_severity','bug','Bug id (matches bug)'); +INSERT INTO column_comments VALUES ('bug_severity','severity_id','Severity id (matches severity)'); CREATE TABLE bug_binpackage ( - bug_id INT NOT NULL REFERENCES bug, - bin_pkg_id INT NOT NULL REFERENCES bin_pkg + id SERIAL PRIMARY KEY, + bug INT NOT NULL REFERENCES bug, + bin_pkg INT NOT NULL REFERENCES bin_pkg ); -CREATE UNIQUE INDEX bug_binpackage_id_pkg_id ON bug_binpackage(bug_id,bin_pkg_id); +CREATE UNIQUE INDEX bug_binpackage_id_pkg_id ON bug_binpackage(bug,bin_pkg); INSERT INTO table_comments VALUES ('bug_binpackage','Bug <-> binary package mapping'); -INSERT INTO column_comments VALUES ('bug_binpackage','bug_id','Bug id (matches bug)'); -INSERT INTO column_comments VALUES ('bug_binpackage','bin_pkg_id','Binary package id (matches bin_pkg)'); +INSERT INTO column_comments VALUES ('bug_binpackage','bug','Bug id (matches bug)'); +INSERT INTO column_comments VALUES ('bug_binpackage','bin_pkg','Binary package id (matches bin_pkg)'); CREATE TABLE bug_srcpackage ( - bug_id INT NOT NULL REFERENCES bug, - src_pkg_id INT NOT NULL REFERENCES src_pkg ON UPDATE CASCADE ON DELETE CASCADE + id SERIAL PRIMARY KEY, + bug INT NOT NULL REFERENCES bug, + src_pkg INT NOT NULL REFERENCES src_pkg ON UPDATE CASCADE ON DELETE CASCADE ); -CREATE UNIQUE INDEX bug_srcpackage_id_pkg_id ON bug_srcpackage(bug_id,src_pkg_id); +CREATE UNIQUE INDEX bug_srcpackage_id_pkg_id ON bug_srcpackage(bug,src_pkg); INSERT INTO table_comments VALUES ('bug_srcpackage','Bug <-> source package mapping'); -INSERT INTO column_comments VALUES ('bug_srcpackage','bug_id','Bug id (matches bug)'); -INSERT INTO column_comments VALUES ('bug_srcpackage','src_pkg_id','Source package id (matches src_pkg)'); +INSERT INTO column_comments VALUES ('bug_srcpackage','bug','Bug id (matches bug)'); +INSERT INTO column_comments VALUES ('bug_srcpackage','src_pkg','Source package id (matches src_pkg)'); -CREATE VIEW bug_package (bug_id,pkg_id,pkg_type,package) AS - SELECT b.bug_id,b.bin_pkg_id,'binary',bp.pkg FROM bug_binpackage b JOIN bin_pkg bp ON bp.id=b.bin_pkg_id UNION - SELECT s.bug_id,s.src_pkg_id,'source',sp.pkg FROM bug_srcpackage s JOIN src_pkg sp ON sp.id=s.src_pkg_id; +CREATE VIEW bug_package (bug,pkg_id,pkg_type,package) AS + SELECT b.bug,b.bin_pkg,'binary',bp.pkg FROM bug_binpackage b JOIN bin_pkg bp ON bp.id=b.bin_pkg UNION + SELECT s.bug,s.src_pkg,'source',sp.pkg FROM bug_srcpackage s JOIN src_pkg sp ON sp.id=s.src_pkg; CREATE VIEW binary_versions (src_pkg, src_ver, bin_pkg, arch, bin_ver) AS SELECT sp.pkg AS src_pkg, sv.ver AS src_ver, bp.pkg AS bin_pkg, a.arch AS arch, b.ver AS bin_ver, svb.ver AS src_ver_based_on, spb.pkg AS src_pkg_based_on FROM bin_ver b JOIN arch a ON b.arch_id = a.id - JOIN bin_pkg bp ON b.bin_pkg_id = bp.id + JOIN bin_pkg bp ON b.bin_pkg = bp.id JOIN src_ver sv ON b.src_ver_id = sv.id - JOIN src_pkg sp ON sv.src_pkg_id = sp.id + JOIN src_pkg sp ON sv.src_pkg = sp.id LEFT OUTER JOIN src_ver svb ON sv.based_on = svb.id - LEFT OUTER JOIN src_pkg spb ON spb.id = svb.src_pkg_id; + LEFT OUTER JOIN src_pkg spb ON spb.id = svb.src_pkg; CREATE TABLE suite ( id SERIAL PRIMARY KEY, @@ -351,6 +376,7 @@ INSERT INTO column_comments VALUES ('message','is_spam','True if this message wa CREATE INDEX ON message(msgid); CREATE TABLE message_refs ( + id SERIAL PRIMARY KEY, message INT NOT NULL REFERENCES message ON DELETE CASCADE ON UPDATE CASCADE, refs INT NOT NULL REFERENCES message ON DELETE CASCADE ON UPDATE CASCADE, inferred BOOLEAN DEFAULT FALSE, @@ -375,9 +401,47 @@ INSERT INTO table_comments VALUES ('correspondent','Individual who has correspon INSERT INTO column_comments VALUES ('correspondent','id','Correspondent ID'); INSERT INTO column_comments VALUES ('correspondent','addr','Correspondent address'); +CREATE TABLE correspondent_full_name( + id SERIAL PRIMARY KEY, + correspondent INT NOT NULL REFERENCES correspondent ON DELETE CASCADE ON UPDATE CASCADE, + full_name TEXT NOT NULL UNIQUE +); + +INSERT INTO table_comments VALUES ('correspondent_full_name','Full names of BTS correspondents'); +INSERT INTO column_comments VALUES ('correspondent_full_name','id','Correspondent full name id'); +INSERT INTO column_comments VALUES ('correspondent_full_name','correpsondent','Correspondent ID (matches correspondent)'); +INSERT INTO column_comments VALUES ('correspondent_full_name','full_name','Correspondent full name (includes e-mail address)'); + +CREATE TABLE bug_submitter ( + id SERIAL PRIMARY KEY, + bug INT NOT NULL REFERENCES bug ON DELETE CASCADE ON UPDATE CASCADE, + submitter INT NOT NULL REFERENCES correspondent ON DELETE CASCADE ON UPDATE CASCADE +); +CREATE INDEX on bug_submitter(submitter); +CREATE UNIQUE INDEX on bug_submitter(bug,submitter); + +INSERT INTO table_comments VALUES ('bug_submitter','Submitter of a bug (connects to correspondent)'); +INSERT INTO column_comments VALUES ('bug_submitter','id','Bug Submitter ID'); +INSERT INTO column_comments VALUES ('bug_submitter','bug','Bug which was submitted by this submitter'); +INSERT INTO column_comments VALUES ('bug_submitter','submitter','Bug submitter (connects to correspondent)'); + +CREATE TABLE bug_done_by ( + id SERIAL PRIMARY KEY, + bug INT NOT NULL REFERENCES bug ON DELETE CASCADE ON UPDATE CASCADE, + done_by INT NOT NULL REFERENCES correspondent ON DELETE CASCADE ON UPDATE CASCADE +); +CREATE INDEX on bug_done_by(done_by); +CREATE UNIQUE INDEX on bug_done_by(bug,done_by); + +INSERT INTO table_comments VALUES ('bug_done_by','Correspondent who finished this bug (emailed -done)'); +INSERT INTO column_comments VALUES ('bug_done_by','id','Bug Done By ID'); +INSERT INTO column_comments VALUES ('bug_done_by','bug','Bug number which was done'); +INSERT INTO column_comments VALUES ('bug_done_by','done_by','Bug finisher (connects to correspondent)'); + CREATE TYPE message_correspondent_type AS ENUM ('to','from','envfrom','cc'); CREATE TABLE message_correspondent ( + id SERIAL PRIMARY KEY, message INT NOT NULL REFERENCES message ON DELETE CASCADE ON UPDATE CASCADE, correspondent INT NOT NULL REFERENCES correspondent ON DELETE CASCADE ON UPDATE CASCADE, correspondent_type message_correspondent_type NOT NULL DEFAULT 'to' @@ -392,6 +456,7 @@ CREATE INDEX ON message_correspondent(correspondent); CREATE INDEX ON message_correspondent(message); CREATE TABLE bug_message ( + id SERIAL PRIMARY KEY, bug INT NOT NULL REFERENCES bug ON DELETE CASCADE ON UPDATE CASCADE, message INT NOT NULL REFERENCES message ON DELETE CASCADE ON UPDATE CASCADE, message_number INT NOT NULL,