Commit 62d123f6 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 527489: Calls to bz_alter_column were dropping the REFERENCES item from the…

Bug 527489: Calls to bz_alter_column were dropping the REFERENCES item from the stored Schema object. Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=ghendricks, a=mkanat
parent 3606f75d
......@@ -537,6 +537,13 @@ sub bz_alter_column {
ThrowCodeError('column_not_null_no_default_alter',
{ name => "$table.$name" }) if ($any_nulls);
}
# Preserve foreign key definitions in the Schema object when altering
# types.
if (defined $current_def->{REFERENCES}) {
# Make sure we don't modify the caller's $new_def.
$new_def = dclone($new_def);
$new_def->{REFERENCES} = $current_def->{REFERENCES};
}
$self->bz_alter_column_raw($table, $name, $new_def, $current_def,
$set_nulls_to);
$self->_bz_real_schema->set_column($table, $name, $new_def);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment