summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkl%redhat.com <>2009-05-26 23:17:43 +0200
committerdkl%redhat.com <>2009-05-26 23:17:43 +0200
commit3caf30c1d8b45aa1e5b49ddb094ea6e7cd8c613f (patch)
treeda28e3a39108931ac624e309f9dda1d399aea9c0
parent49c4e3b294c8617972c2a65919533e3a630696eb (diff)
downloadbugzilla-3caf30c1d8b45aa1e5b49ddb094ea6e7cd8c613f.tar.gz
bugzilla-3caf30c1d8b45aa1e5b49ddb094ea6e7cd8c613f.tar.xz
Bug 462067 - Add FK constraints to the bugs table for user, product, and component int fields
Patch by David Lawrence <dkl@redhat.com> - r=mkanat a=LpSolit
-rw-r--r--Bugzilla/DB/Schema.pm20
1 files changed, 15 insertions, 5 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm
index f31a312cf..5416a9fe8 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,