From aaba5db2aed1ac418d6e4421c1c2760d9c739b70 Mon Sep 17 00:00:00 2001 From: "David Lawrence [:dkl]" Date: Tue, 17 Jun 2014 14:30:28 +0800 Subject: Bug 649691: Add a "mentor" and "mentored bug type" field to b.m.o (schema only) --- extensions/Review/Extension.pm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'extensions') diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm index 3f3383697..6509218f3 100644 --- a/extensions/Review/Extension.pm +++ b/extensions/Review/Extension.pm @@ -670,6 +670,36 @@ sub db_schema_abstract_schema { }, ], }; + + $args->{'schema'}->{'bug_mentors'} = { + FIELDS => [ + bug_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'bugs', + COLUMN => 'bug_id', + DELETE => 'CASCADE', + }, + }, + user_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE', + } + }, + ], + INDEXES => [ + bug_mentors_idx => { + FIELDS => [ 'bug_id', 'user_id' ], + TYPE => 'UNIQUE', + }, + bug_mentors_bug_id_idx => [ 'bug_id' ], + ], + }; } sub install_update_db { @@ -690,6 +720,13 @@ sub install_update_db { 'profiles', 'needinfo_request_count', { TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0 } ); + my $field = Bugzilla::Field->new({ name => 'bug_mentor' }); + if (!$field) { + Bugzilla::Field->create({ + name => 'bug_mentor', + description => 'Mentor' + }); + } } sub install_filesystem { -- cgit v1.2.3-24-g4f1b