]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 359234: missing indexes on the cc and profiles table cause upgrades to fail
authormkanat%bugzilla.org <>
Sat, 4 Nov 2006 07:12:01 +0000 (07:12 +0000)
committermkanat%bugzilla.org <>
Sat, 4 Nov 2006 07:12:01 +0000 (07:12 +0000)
Patch By Noel Cragg <noel@red-bean.com> r=mkanat, a=myk

checksetup.pl

index 776d014389f83bc156c8a55899f78fecc8eeb29b..21c37e4c74d149307ad4b7f41f4c5c1123a40ca5 100755 (executable)
@@ -35,6 +35,7 @@
 #                 Lance Larsh <lance.larsh@oracle.com>
 #                 A. Karl Kornel <karl@kornel.name>
 #                 Marc Schumann <wurblzap@gmail.com>
+#                 Noel Cragg <noel@red-bean.com>
 #
 #
 #
@@ -2261,8 +2262,9 @@ if (!$dbh->bz_column_info('bugs', 'lastdiffed')) {
 # declared to be unique.  Sure enough, somehow, I got 22 duplicated entries
 # in my database.  This code detects that, cleans up the duplicates, and
 # then tweaks the table to declare the field to be unique.  What a pain.
-if (!$dbh->bz_index_info('profiles', 'profiles_login_name_idx') ||
-    !$dbh->bz_index_info('profiles', 'profiles_login_name_idx')->{TYPE}) {
+if (!$dbh->bz_index_info('profiles', 'profiles_login_name_idx')
+    || !$dbh->bz_index_info('profiles', 'profiles_login_name_idx')->{TYPE})
+{
     print "Searching for duplicate entries in the profiles table ...\n";
     while (1) {
         # This code is weird in that it loops around and keeps doing this
@@ -2495,7 +2497,9 @@ if (!$dbh->bz_column_info('products', 'defaultmilestone')) {
 # prevents certain database inconsistencies, and, moreover, is required for
 # new generalized list code to work.
 
-if (!$dbh->bz_index_info('cc', 'cc_bug_id_idx')->{TYPE}) {
+if (!$dbh->bz_index_info('cc', 'cc_bug_id_idx')
+    || !$dbh->bz_index_info('cc', 'cc_bug_id_idx')->{TYPE})
+{
 
     # XXX should eliminate duplicate entries before altering
     #
@@ -2504,7 +2508,9 @@ if (!$dbh->bz_index_info('cc', 'cc_bug_id_idx')->{TYPE}) {
                       {TYPE => 'UNIQUE', FIELDS => [qw(bug_id who)]});
 }    
 
-if (!$dbh->bz_index_info('keywords', 'keywords_bug_id_idx')->{TYPE}) {
+if (!$dbh->bz_index_info('keywords', 'keywords_bug_id_idx')
+    || !$dbh->bz_index_info('keywords', 'keywords_bug_id_idx')->{TYPE})
+{
 
     # XXX should eliminate duplicate entries before altering
     #