diff options
author | mkanat%bugzilla.org <> | 2009-08-03 18:08:09 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-08-03 18:08:09 +0000 |
commit | c253b28a9ac660be1db0212967342eef2c4f142d (patch) | |
tree | d0de41b5dda249046331f965995c85a3790a755b /Bugzilla | |
parent | Bug 508032: Speed up initializing of email_setting values (diff) | |
download | bugzilla-c253b28a9ac660be1db0212967342eef2c4f142d.tar.gz bugzilla-c253b28a9ac660be1db0212967342eef2c4f142d.tar.bz2 bugzilla-c253b28a9ac660be1db0212967342eef2c4f142d.zip |
Additional fix for bug 508023, to make upgrades from 3.1.4 succeed.
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/DB/Schema/Mysql.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 49e6add1a..95ef3141e 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -189,13 +189,15 @@ sub get_alter_column_ddl { my %new_defaultless = %$new_def; delete $old_defaultless{DEFAULT}; delete $new_defaultless{DEFAULT}; - if ($self->columns_equal(\%new_defaultless, \%old_defaultless)) { - if (defined $old_def->{DEFAULT} and !defined $new_def->{DEFAULT}) { + if (!$self->columns_equal($old_def, $new_def) + && $self->columns_equal(\%new_defaultless, \%old_defaultless)) + { + if (!defined $new_def->{DEFAULT}) { push(@statements, "ALTER TABLE $table ALTER COLUMN $column DROP DEFAULT"); } else { - push(@statements, "ALTER TABLE $table ALTER COLUMN $column + push(@statements, "ALTER TABLE $table ALTER COLUMN $column SET DEFAULT " . $new_def->{DEFAULT}); } } |