aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-10-29 02:23:05 +0000
committerlpsolit%gmail.com <>2008-10-29 02:23:05 +0000
commit7d8aa7af0dd2663e72e7f2f8b33927d396d6a146 (patch)
treee18a2ad8d0921e1a5ccd0bdae36c0dc4548711e8
parentf5afeb3841a89bd58cfd12832ab05bf7eae75439 (diff)
downloadbugs-7d8aa7af0dd2663e72e7f2f8b33927d396d6a146.tar
bugs-7d8aa7af0dd2663e72e7f2f8b33927d396d6a146.tar.gz
bugs-7d8aa7af0dd2663e72e7f2f8b33927d396d6a146.tar.bz2
bugs-7d8aa7af0dd2663e72e7f2f8b33927d396d6a146.tar.xz
bugs-7d8aa7af0dd2663e72e7f2f8b33927d396d6a146.zip
Bug 427455: Add foreign key constraints for group_control_map, user_group_map and group_group_map tables - Patch by Tony Fu <tfu@redhat.com> r/a=mkanat
-rw-r--r--Bugzilla/DB/Schema.pm30
1 files changed, 24 insertions, 6 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm
index 80a964446..f9fc8438a 100644
--- a/Bugzilla/DB/Schema.pm
+++ b/Bugzilla/DB/Schema.pm
@@ -993,8 +993,14 @@ use constant ABSTRACT_SCHEMA => {
group_control_map => {
FIELDS => [
- group_id => {TYPE => 'INT3', NOTNULL => 1},
- product_id => {TYPE => 'INT2', NOTNULL => 1},
+ group_id => {TYPE => 'INT3', NOTNULL => 1,
+ REFERENCES => {TABLE => 'groups',
+ COLUMN => 'id',
+ DELETE => 'CASCADE'}},
+ product_id => {TYPE => 'INT2', NOTNULL => 1,
+ REFERENCES => {TABLE => 'products',
+ COLUMN => 'id',
+ DELETE => 'CASCADE'}},
entry => {TYPE => 'BOOLEAN', NOTNULL => 1},
membercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1},
othercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1},
@@ -1022,8 +1028,14 @@ use constant ABSTRACT_SCHEMA => {
# if GRANT_REGEXP - record was created by evaluating a regexp
user_group_map => {
FIELDS => [
- user_id => {TYPE => 'INT3', NOTNULL => 1},
- group_id => {TYPE => 'INT3', NOTNULL => 1},
+ user_id => {TYPE => 'INT3', NOTNULL => 1,
+ REFERENCES => {TABLE => 'profiles',
+ COLUMN => 'userid',
+ DELETE => 'CASCADE'}},
+ group_id => {TYPE => 'INT3', NOTNULL => 1,
+ REFERENCES => {TABLE => 'groups',
+ COLUMN => 'id',
+ DELETE => 'CASCADE'}},
isbless => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'},
grant_type => {TYPE => 'INT1', NOTNULL => 1,
@@ -1045,8 +1057,14 @@ use constant ABSTRACT_SCHEMA => {
# if GROUP_VISIBLE - member groups may see grantor group
group_group_map => {
FIELDS => [
- member_id => {TYPE => 'INT3', NOTNULL => 1},
- grantor_id => {TYPE => 'INT3', NOTNULL => 1},
+ member_id => {TYPE => 'INT3', NOTNULL => 1,
+ REFERENCES => {TABLE => 'groups',
+ COLUMN => 'id',
+ DELETE => 'CASCADE'}},
+ grantor_id => {TYPE => 'INT3', NOTNULL => 1,
+ REFERENCES => {TABLE => 'groups',
+ COLUMN => 'id',
+ DELETE => 'CASCADE'}},
grant_type => {TYPE => 'INT1', NOTNULL => 1,
DEFAULT => GROUP_MEMBERSHIP},
],