Commit 7d8aa7af authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 427455: Add foreign key constraints for group_control_map, user_group_map…

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
parent f5afeb38
...@@ -993,8 +993,14 @@ use constant ABSTRACT_SCHEMA => { ...@@ -993,8 +993,14 @@ use constant ABSTRACT_SCHEMA => {
group_control_map => { group_control_map => {
FIELDS => [ FIELDS => [
group_id => {TYPE => 'INT3', NOTNULL => 1}, group_id => {TYPE => 'INT3', NOTNULL => 1,
product_id => {TYPE => 'INT2', 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}, entry => {TYPE => 'BOOLEAN', NOTNULL => 1},
membercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1}, membercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1},
othercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1}, othercontrol => {TYPE => 'BOOLEAN', NOTNULL => 1},
...@@ -1022,8 +1028,14 @@ use constant ABSTRACT_SCHEMA => { ...@@ -1022,8 +1028,14 @@ use constant ABSTRACT_SCHEMA => {
# if GRANT_REGEXP - record was created by evaluating a regexp # if GRANT_REGEXP - record was created by evaluating a regexp
user_group_map => { user_group_map => {
FIELDS => [ FIELDS => [
user_id => {TYPE => 'INT3', NOTNULL => 1}, user_id => {TYPE => 'INT3', NOTNULL => 1,
group_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, isbless => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'}, DEFAULT => 'FALSE'},
grant_type => {TYPE => 'INT1', NOTNULL => 1, grant_type => {TYPE => 'INT1', NOTNULL => 1,
...@@ -1045,8 +1057,14 @@ use constant ABSTRACT_SCHEMA => { ...@@ -1045,8 +1057,14 @@ use constant ABSTRACT_SCHEMA => {
# if GROUP_VISIBLE - member groups may see grantor group # if GROUP_VISIBLE - member groups may see grantor group
group_group_map => { group_group_map => {
FIELDS => [ FIELDS => [
member_id => {TYPE => 'INT3', NOTNULL => 1}, member_id => {TYPE => 'INT3', NOTNULL => 1,
grantor_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, grant_type => {TYPE => 'INT1', NOTNULL => 1,
DEFAULT => GROUP_MEMBERSHIP}, DEFAULT => GROUP_MEMBERSHIP},
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment