From: dkl%redhat.com <> Date: Tue, 26 May 2009 21:17:43 +0000 (+0000) Subject: Bug 462067 - Add FK constraints to the bugs table for user, product, and component... X-Git-Tag: bugzilla-3.5.1~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3caf30c1d8b45aa1e5b49ddb094ea6e7cd8c613f;p=thirdparty%2Fbugzilla.git Bug 462067 - Add FK constraints to the bugs table for user, product, and component int fields Patch by David Lawrence - r=mkanat a=LpSolit --- diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index f31a312cf7..5416a9fe87 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -241,7 +241,9 @@ use constant ABSTRACT_SCHEMA => { FIELDS => [ bug_id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, - assigned_to => {TYPE => 'INT3', NOTNULL => 1}, + assigned_to => {TYPE => 'INT3', NOTNULL => 1, + REFERENCES => {TABLE => 'profiles', + COLUMN => 'userid'}}, bug_file_loc => {TYPE => 'MEDIUMTEXT'}, bug_severity => {TYPE => 'varchar(64)', NOTNULL => 1}, bug_status => {TYPE => 'varchar(64)', NOTNULL => 1}, @@ -250,16 +252,24 @@ use constant ABSTRACT_SCHEMA => { short_desc => {TYPE => 'varchar(255)', NOTNULL => 1}, op_sys => {TYPE => 'varchar(64)', NOTNULL => 1}, priority => {TYPE => 'varchar(64)', NOTNULL => 1}, - product_id => {TYPE => 'INT2', NOTNULL => 1}, + product_id => {TYPE => 'INT2', NOTNULL => 1, + REFERENCES => {TABLE => 'products', + COLUMN => 'id'}}, rep_platform => {TYPE => 'varchar(64)', NOTNULL => 1}, - reporter => {TYPE => 'INT3', NOTNULL => 1}, + reporter => {TYPE => 'INT3', NOTNULL => 1, + REFERENCES => {TABLE => 'profiles', + COLUMN => 'userid'}}, version => {TYPE => 'varchar(64)', NOTNULL => 1}, - component_id => {TYPE => 'INT2', NOTNULL => 1}, + component_id => {TYPE => 'INT2', NOTNULL => 1, + REFERENCES => {TABLE => 'components', + COLUMN => 'id'}}, resolution => {TYPE => 'varchar(64)', NOTNULL => 1, DEFAULT => "''"}, target_milestone => {TYPE => 'varchar(20)', NOTNULL => 1, DEFAULT => "'---'"}, - qa_contact => {TYPE => 'INT3'}, + qa_contact => {TYPE => 'INT3', + REERENCES => {TABLE => 'profiles', + COLUMN => 'userid'}}, status_whiteboard => {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => "''"}, votes => {TYPE => 'INT3', NOTNULL => 1,