From: Don Armstrong Date: Mon, 3 Dec 2012 23:58:19 +0000 (-0800) Subject: add more documentation of the debbugs schema X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0543095981356edd47de6a30981740c0d2d2a7ac;hp=31f3134020f4e82feada1355a8c9f9488465cd1c;p=debbugs.git add more documentation of the debbugs schema --- diff --git a/Debbugs/DB/Result/Bug.pm b/Debbugs/DB/Result/Bug.pm index d01892c..51a964d 100644 --- a/Debbugs/DB/Result/Bug.pm +++ b/Debbugs/DB/Result/Bug.pm @@ -6,7 +6,7 @@ package Debbugs::DB::Result::Bug; =head1 NAME -Debbugs::DB::Result::Bug +Debbugs::DB::Result::Bug - Bugs =cut @@ -40,6 +40,8 @@ __PACKAGE__->table("bug"); data_type: 'integer' is_nullable: 0 +Bug number + =head2 creation data_type: 'timestamp with time zone' @@ -47,6 +49,8 @@ __PACKAGE__->table("bug"); is_nullable: 0 original: {default_value => \"now()"} +Time bug created + =head2 log_modified data_type: 'timestamp with time zone' @@ -54,6 +58,8 @@ __PACKAGE__->table("bug"); is_nullable: 0 original: {default_value => \"now()"} +Time bug log was last modified + =head2 last_modified data_type: 'timestamp with time zone' @@ -61,58 +67,78 @@ __PACKAGE__->table("bug"); is_nullable: 0 original: {default_value => \"now()"} +Time bug status was last modified + =head2 archived data_type: 'boolean' default_value: false is_nullable: 0 +True if bug has been archived + =head2 unarchived data_type: 'timestamp with time zone' is_nullable: 1 +Time bug was last unarchived; null if bug has never been unarchived + =head2 forwarded data_type: 'text' default_value: (empty string) is_nullable: 0 +Where bug has been forwarded to; empty if it has not been forwarded + =head2 summary data_type: 'text' default_value: (empty string) is_nullable: 0 +Summary of the bug; empty if it has no summary + =head2 outlook data_type: 'text' default_value: (empty string) is_nullable: 0 +Outlook of the bug; empty if it has no outlook + =head2 subject data_type: 'text' is_nullable: 0 +Subject of the bug + =head2 done data_type: 'text' default_value: (empty string) is_nullable: 0 +Individual who did the -done; empty if it has never been -done + =head2 owner data_type: 'text' default_value: (empty string) is_nullable: 0 +Individual who did the -done; empty if it has never been -done + =head2 unknown_packages data_type: 'text' default_value: (empty string) is_nullable: 0 +Package name if the package is not known + =head2 severity data_type: 'enum' @@ -120,6 +146,8 @@ __PACKAGE__->table("bug"); extra: {custom_type_name => "bug_severity",list => ["wishlist","minor","normal","important","serious","grave","critical"]} is_nullable: 1 +Bug severity + =cut __PACKAGE__->add_columns( @@ -334,8 +362,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-29 15:37:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yAz+VGSyK89KOcvUzGnleA +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-29 18:11:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eW7Cg2dL1CbA9Rn+nzZqOg # 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 074b29b..061b9ab 100644 --- a/Debbugs/DB/Result/BugBlock.pm +++ b/Debbugs/DB/Result/BugBlock.pm @@ -6,7 +6,7 @@ package Debbugs::DB::Result::BugBlock; =head1 NAME -Debbugs::DB::Result::BugBlock +Debbugs::DB::Result::BugBlock - Bugs which block other bugs =cut @@ -41,12 +41,16 @@ __PACKAGE__->table("bug_blocks"); is_foreign_key: 1 is_nullable: 0 +Bug number + =head2 blocks data_type: 'integer' is_foreign_key: 1 is_nullable: 0 +Bug number which is blocked by bug_id + =cut __PACKAGE__->add_columns( @@ -105,8 +109,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:adv4v35ZqedSG4L0CFNPMg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-29 18:11:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WLr8TlnQMEVUj2maG0WFCw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/BugMerged.pm b/Debbugs/DB/Result/BugMerged.pm index 8c38428..dce877c 100644 --- a/Debbugs/DB/Result/BugMerged.pm +++ b/Debbugs/DB/Result/BugMerged.pm @@ -6,7 +6,7 @@ package Debbugs::DB::Result::BugMerged; =head1 NAME -Debbugs::DB::Result::BugMerged +Debbugs::DB::Result::BugMerged - Bugs which are merged with other bugs =cut @@ -41,12 +41,16 @@ __PACKAGE__->table("bug_merged"); is_foreign_key: 1 is_nullable: 0 +Bug number + =head2 merged data_type: 'integer' is_foreign_key: 1 is_nullable: 0 +Bug number which is merged with bug_id + =cut __PACKAGE__->add_columns( @@ -105,8 +109,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:xCalzFeFWcT0PGF/+82yvA +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-29 18:11:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hgozwwtpX5QCWb1FgIgIlw # 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 e8d9da2..3b1e21e 100644 --- a/Debbugs/DB/Result/BugVer.pm +++ b/Debbugs/DB/Result/BugVer.pm @@ -6,7 +6,7 @@ package Debbugs::DB::Result::BugVer; =head1 NAME -Debbugs::DB::Result::BugVer +Debbugs::DB::Result::BugVer - Bug versions =cut @@ -186,8 +186,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-23 17:41:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JMDsn7GGxoQ001KYUOyyTw +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-12-03 15:57:07 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YRlFlDUKGtk69o3KPHM1zQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/Maintainer.pm b/Debbugs/DB/Result/Maintainer.pm index 6993789..8ab3d54 100644 --- a/Debbugs/DB/Result/Maintainer.pm +++ b/Debbugs/DB/Result/Maintainer.pm @@ -6,7 +6,7 @@ package Debbugs::DB::Result::Maintainer; =head1 NAME -Debbugs::DB::Result::Maintainer +Debbugs::DB::Result::Maintainer - Package maintainer names =cut @@ -42,11 +42,15 @@ __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 created data_type: 'timestamp with time zone' @@ -54,6 +58,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 +67,8 @@ __PACKAGE__->table("maintainer"); is_nullable: 0 original: {default_value => \"now()"} +Time maintainer record modified + =cut __PACKAGE__->add_columns( @@ -133,8 +141,8 @@ __PACKAGE__->has_many( ); -# 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.07025 @ 2012-11-29 18:11:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:34HJCwoLU+I0PN5A1EzhYA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Debbugs/DB/Result/SrcPkg.pm b/Debbugs/DB/Result/SrcPkg.pm index 66d6268..01d61f0 100644 --- a/Debbugs/DB/Result/SrcPkg.pm +++ b/Debbugs/DB/Result/SrcPkg.pm @@ -6,7 +6,7 @@ package Debbugs::DB::Result::SrcPkg; =head1 NAME -Debbugs::DB::Result::SrcPkg +Debbugs::DB::Result::SrcPkg - Source packages =cut @@ -42,11 +42,15 @@ __PACKAGE__->table("src_pkg"); is_nullable: 0 sequence: 'src_pkg_id_seq' +Source package id + =head2 pkg data_type: 'text' is_nullable: 0 +Source package name + =head2 pseduopkg data_type: 'boolean' @@ -59,6 +63,8 @@ __PACKAGE__->table("src_pkg"); is_foreign_key: 1 is_nullable: 1 +Source package id which this source package is an alias of + =cut __PACKAGE__->add_columns( @@ -186,8 +192,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-23 17:41:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:s3tqzD1crqO0a57NzVkWDg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-12-03 15:57:07 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zKfk7AmIYswUAYKBbBGQaQ # 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 02177e9..2ab36e7 100644 --- a/Debbugs/DB/Result/SrcVer.pm +++ b/Debbugs/DB/Result/SrcVer.pm @@ -6,7 +6,7 @@ package Debbugs::DB::Result::SrcVer; =head1 NAME -Debbugs::DB::Result::SrcVer +Debbugs::DB::Result::SrcVer - Source Package versions =cut @@ -42,23 +42,31 @@ __PACKAGE__->table("src_ver"); is_nullable: 0 sequence: 'src_ver_id_seq' +Source package version id + =head2 src_pkg_id data_type: 'integer' is_foreign_key: 1 is_nullable: 0 +Source package id (matches src_pkg table) + =head2 ver data_type: 'debversion' is_nullable: 0 +Version of the source package + =head2 maintainer_id data_type: 'integer' is_foreign_key: 1 is_nullable: 1 +Maintainer id (matches maintainer table) + =head2 upload_date data_type: 'timestamp with time zone' @@ -66,12 +74,16 @@ __PACKAGE__->table("src_ver"); is_nullable: 0 original: {default_value => \"now()"} +Date this version of the source package was uploaded + =head2 based_on data_type: 'integer' is_foreign_key: 1 is_nullable: 1 +Source package version this version is based on + =cut __PACKAGE__->add_columns( @@ -245,8 +257,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-11-25 00:09:07 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1YjejvJjXTE1Q6OjD5x9zg +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-12-03 15:57:07 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YB4WADgoa3KiJq2OdeSmmQ # 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 7187643..958be25 100644 --- a/sql/debbugs_schema.sql +++ b/sql/debbugs_schema.sql @@ -27,6 +27,22 @@ DROP TABLE corespondent CASCADE; DROP TABLE message_refs CASCADE; DROP TABLE message CASCADE; DROP TYPE message_corespondent_type CASCADE; +DROP TABLE table_comments CASCADE; +DROP TABLE column_comments CASCADE; + +-- the following two tables are used to provide documentation about +-- the tables and columns for DBIx::Class::Schema::Loader +CREATE TABLE table_comments ( + table_name TEXT UNIQUE NOT NULL, + comment_text TEXT NOT NULL +); +CREATE TABLE column_comments ( + table_name TEXT NOT NULL, + column_name TEXT NOT NULL, + comment_text TEXT NOT NULL +); +CREATE UNIQUE INDEX ON column_comments(table_name,column_name); + -- severities CREATE TYPE bug_severity AS ENUM ('wishlist','minor','normal', 'important','serious','grave','critical'); @@ -37,6 +53,11 @@ CREATE TABLE maintainer ( created TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL, modified TIMESTAMP WITH TIME ZONE DEFAULT NOW() NOT NULL ); +INSERT INTO table_comments VALUES ('maintainer','Package maintainer names'); +INSERT INTO column_comments VALUES ('maintainer','id','Package maintainer id'); +INSERT INTO column_comments VALUES ('maintainer','name','Name of package maintainer'); +INSERT INTO column_comments VALUES ('maintainer','created','Time maintainer record created'); +INSERT INTO column_comments VALUES ('maintainer','modified','Time maintainer record modified'); -- bugs table CREATE TABLE bug ( @@ -55,6 +76,23 @@ CREATE TABLE bug ( unknown_packages TEXT NOT NULL DEfAULT '', severity bug_severity DEFAULT 'normal'::bug_severity ); +INSERT INTO table_comments VALUES ('bug','Bugs'); +INSERT INTO column_comments VALUES ('bug','id','Bug number'); +INSERT INTO column_comments VALUES ('bug','creation','Time bug created'); +INSERT INTO column_comments VALUES ('bug','log_modified','Time bug log was last modified'); +INSERT INTO column_comments VALUES ('bug','last_modified','Time bug status was last modified'); +INSERT INTO column_comments VALUES ('bug','archived','True if bug has been archived'); +INSERT INTO column_comments VALUES ('bug','unarchived','Time bug was last unarchived; null if bug has never been unarchived'); +INSERT INTO column_comments VALUES ('bug','forwarded','Where bug has been forwarded to; empty if it has not been forwarded'); +INSERT INTO column_comments VALUES ('bug','summary','Summary of the bug; empty if it has no summary'); +INSERT INTO column_comments VALUES ('bug','outlook','Outlook of the bug; empty if it has no outlook'); +INSERT INTO column_comments VALUES ('bug','subject','Subject of the bug'); +INSERT INTO column_comments VALUES ('bug','done','Individual who did the -done; empty if it has never been -done'); +INSERT INTO column_comments VALUES ('bug','owner','Individual who did the -done; empty if it has never been -done'); +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, @@ -64,6 +102,10 @@ CREATE TABLE 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 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'); + CREATE TABLE bug_merged ( bug_id INT NOT NULL REFERENCES bug, @@ -73,6 +115,9 @@ CREATE TABLE 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 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'); CREATE TABLE src_pkg ( id SERIAL PRIMARY KEY, @@ -81,6 +126,13 @@ CREATE TABLE src_pkg ( alias_of INT REFERENCES src_pkg ON UPDATE CASCADE ON DELETE CASCADE CONSTRAINT src_pkg_doesnt_alias_itself CHECK (id <> alias_of) ); +INSERT INTO table_comments VALUES ('src_pkg','Source packages'); +INSERT INTO column_comments VALUES ('src_pkg','id','Source package id'); +INSERT INTO column_comments VALUES ('src_pkg','pkg','Source package name'); +INSERT INTO column_comments VALUES ('src_pkg','pseudopkg','True if this is a pseudo package'); +INSERT INTO column_comments VALUES ('src_pkg','alias_of','Source package id which this source package is an alias of'); + + CREATE TABLE src_ver ( id SERIAL PRIMARY KEY, @@ -94,6 +146,15 @@ CREATE TABLE src_ver ( ON UPDATE CASCADE ON DELETE CASCADE ); CREATE UNIQUE INDEX src_ver_src_pkg_id_ver ON src_ver(src_pkg_id,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','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'); +INSERT INTO column_comments VALUES ('src_ver','based_on','Source package version this version is based on'); + + CREATE TABLE bug_ver ( bug_id INT NOT NULL REFERENCES bug @@ -111,6 +172,7 @@ 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_ver_id_idx ON bug_ver(src_ver_id); CREATE UNIQUE INDEX ON bug_ver(bug_id,ver_string,found); +INSERT INTO table_comments VALUES ('bug_ver','Bug versions'); CREATE TABLE arch ( id SERIAL PRIMARY KEY,