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.


git-svn-id: svn://10.0.0.236/trunk@260519 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org 2010-06-22 05:46:34 +00:00
parent c410a8b45b
commit 29564ffa8f
2 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
7234
7235

View File

@ -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.)