diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-06-21 22:31:02 -0700 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-06-21 22:31:02 -0700 |
commit | 6449a442d20bd8047767e48af850d8bdef3186b5 (patch) | |
tree | eb065527caddfc2391baab7bdb381f2f62bef02a /Bugzilla/DB | |
parent | 902404f7a1568fc01398ec895dc73baa3a75f4fc (diff) | |
download | bugs-6449a442d20bd8047767e48af850d8bdef3186b5.tar bugs-6449a442d20bd8047767e48af850d8bdef3186b5.tar.gz bugs-6449a442d20bd8047767e48af850d8bdef3186b5.tar.bz2 bugs-6449a442d20bd8047767e48af850d8bdef3186b5.tar.xz bugs-6449a442d20bd8047767e48af850d8bdef3186b5.zip |
The DB::Schema alter_column default fix also needed to be separately
applied to DB::Schema::Oracle, since it has a full override of
get_alter_column_ddl.
https://bugzilla.mozilla.org/show_bug.cgi?id=573441
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r-- | Bugzilla/DB/Schema/Oracle.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/DB/Schema/Oracle.pm b/Bugzilla/DB/Schema/Oracle.pm index af0c11e9f..6011cecfc 100644 --- a/Bugzilla/DB/Schema/Oracle.pm +++ b/Bugzilla/DB/Schema/Oracle.pm @@ -214,6 +214,10 @@ sub get_alter_column_ddl { my $default = $new_def->{DEFAULT}; my $default_old = $old_def->{DEFAULT}; + + if (defined $default) { + $default = $specific->{$default} if exists $specific->{$default}; + } # This first condition prevents "uninitialized value" errors. if (!defined $default && !defined $default_old) { # Do Nothing @@ -227,7 +231,6 @@ sub get_alter_column_ddl { elsif ( (defined $default && !defined $default_old) || ($default ne $default_old) ) { - $default = $specific->{$default} if exists $specific->{$default}; push(@statements, "ALTER TABLE $table MODIFY $column " . " DEFAULT $default"); } @@ -236,7 +239,7 @@ sub get_alter_column_ddl { if (!$old_def->{NOTNULL} && $new_def->{NOTNULL}) { my $setdefault; # Handle any fields that were NULL before, if we have a default, - $setdefault = $new_def->{DEFAULT} if exists $new_def->{DEFAULT}; + $setdefault = $default if defined $default; # But if we have a set_nulls_to, that overrides the DEFAULT # (although nobody would usually specify both a default and # a set_nulls_to.) |