]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 577053: When upgrading from a version earlier than 4.0,
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 6 Jul 2010 03:48:42 +0000 (20:48 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 6 Jul 2010 03:48:42 +0000 (20:48 -0700)
change the logic on how we check to see if we need to populate
the status_workflow table for an upgrading installation, because
it was broken for upgrades from 2.18 and earlier.

Bugzilla/Install/DB.pm

index ce567528b2a18f86a258858109d15b94a5cab4d4..ada500c586a50414e453be75824688657a6ab88e 100644 (file)
@@ -2928,8 +2928,6 @@ sub _initialize_workflow_for_upgrade {
     my $old_params = shift;
     my $dbh = Bugzilla->dbh;
 
-    my $had_is_open = $dbh->bz_column_info('bug_status', 'is_open');
-
     $dbh->bz_add_column('bug_status', 'is_open',
                         {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'TRUE'});
 
@@ -2963,8 +2961,10 @@ sub _initialize_workflow_for_upgrade {
     }
 
     # We only populate the workflow here if we're upgrading from a version
-    # before 3.2.
-    return if $had_is_open;
+    # before 4.0 (which is where init_workflow was added).
+    my $new_exists = $dbh->selectrow_array(
+         'SELECT 1 FROM bug_status WHERE value = ?', undef, 'NEW');
+    return if !$new_exists;
 
     # Populate the status_workflow table. We do nothing if the table already
     # has entries. If all bug status transitions have been deleted, the