From d23802e8b18093a2d257b319f02f6e0942326b67 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Mon, 23 Jul 2012 17:27:16 -0400 Subject: Bug 764457 - Add a primary key to the bugs_activity table r=glob, a=LpSolit --- Bugzilla/DB/Schema.pm | 2 ++ Bugzilla/Install/DB.pm | 4 ++++ contrib/recode.pl | 1 + 3 files changed, 7 insertions(+) diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 70b0c0650..f8469e66e 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -342,6 +342,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 baf9adeed..39bfca602 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -674,6 +674,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 f8de12eb1..76e10ad2c 100755 --- a/contrib/recode.pl +++ b/contrib/recode.pl @@ -42,6 +42,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', -- cgit v1.2.3-24-g4f1b