From: Dave Lawrence Date: Mon, 23 Jul 2012 21:23:43 +0000 (-0400) Subject: Bug 764457 - Add a primary key to the bugs_activity table X-Git-Tag: bugzilla-4.3.2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dce1aa3a9ec8898b0dbcadfc3d7a4bdb5893327;p=thirdparty%2Fbugzilla.git Bug 764457 - Add a primary key to the bugs_activity table r=glob, a=LpSolit --- diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index fadc38fc5b..7293d25d89 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -322,6 +322,8 @@ use constant ABSTRACT_SCHEMA => { bugs_activity => { FIELDS => [ + id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, + PRIMARYKEY => 1}, bug_id => {TYPE => 'INT3', NOTNULL => 1, REFERENCES => {TABLE => 'bugs', COLUMN => 'bug_id', diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index ba656a769d..f516748b90 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -678,6 +678,10 @@ sub update_table_definitions { { TYPE => 'varchar(255)' }); $dbh->bz_add_index('bugs_activity', 'bugs_activity_removed_idx', ['removed']); + # 2012-06-13 dkl@mozilla.com - Bug 764457 + $dbh->bz_add_column('bugs_activity', 'id', + {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ diff --git a/contrib/recode.pl b/contrib/recode.pl index 880bc4e466..cf0997a528 100755 --- a/contrib/recode.pl +++ b/contrib/recode.pl @@ -29,6 +29,7 @@ use constant MAX_STRING_LEN => 25; # For certain tables, we can't automatically determine their Primary Key. # So, we specify it here as a string. use constant SPECIAL_KEYS => { + # bugs_activity since 4.4 has a unique primary key added bugs_activity => 'bug_id,bug_when,fieldid', profile_setting => 'user_id,setting_name', profiles_activity => 'userid,profiles_when,fieldid',