Bug 577577: Make bz_drop_fk be tolerant of SQL failure

r=mkanat, a=mkanat (module owner)


git-svn-id: svn://10.0.0.236/branches/BUGZILLA-3_6-BRANCH@260688 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org 2010-07-08 23:50:06 +00:00
parent 02a5d0b4b6
commit e9e2f8e908
2 changed files with 9 additions and 3 deletions

View File

@ -1 +1 @@
7126
7127

View File

@ -745,8 +745,14 @@ sub bz_drop_fk {
print get_text('install_fk_drop',
{ table => $table, column => $column, fk => $def })
. "\n" if Bugzilla->usage_mode == USAGE_MODE_CMDLINE;
my @sql = $self->_bz_real_schema->get_drop_fk_sql($table,$column,$def);
$self->do($_) foreach @sql;
my @statements =
$self->_bz_real_schema->get_drop_fk_sql($table,$column,$def);
foreach my $sql (@statements) {
# Because this is a deletion, we don't want to die hard if
# we fail because of some local customization. If something
# is already gone, that's fine with us!
eval { $self->do($sql); } or warn "Failed SQL: [$sql] Error: $@";
}
delete $col_def->{REFERENCES};
$self->_bz_real_schema->set_column($table, $column, $col_def);
$self->_bz_store_real_schema;