From c253b28a9ac660be1db0212967342eef2c4f142d Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 3 Aug 2009 18:08:09 +0000 Subject: Additional fix for bug 508023, to make upgrades from 3.1.4 succeed. --- Bugzilla/DB/Schema/Mysql.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Bugzilla') 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}); } } -- cgit v1.2.3-24-g4f1b