From: Sven Schöling Date: Wed, 30 Mar 2016 09:29:34 +0000 (+0200) Subject: DBUpgrade2: may_fail für reine sql Queries auch honorieren. X-Git-Tag: release-3.4.1~275 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2a79838fd644d6469c549e34a5dea606fe8da207;p=kivitendo-erp.git DBUpgrade2: may_fail für reine sql Queries auch honorieren. --- diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index eb366e122..840a1dd7c 100644 --- a/SL/DBUpgrade2.pm +++ b/SL/DBUpgrade2.pm @@ -186,11 +186,13 @@ sub process_query { return $errstr // '' if $self->{return_on_error}; $sth->finish(); $dbh->rollback(); - $form->dberror("The database update/creation did not succeed. " . - "The file ${filename} containing the following " . - "query failed:
${query}
" . - "The error message was: ${errstr}
" . - "All changes in that file have been reverted."); + if (!ref $version_or_control || ref $version_or_control ne 'HASH' || !$version_or_control->{may_fail}) { + $form->dberror("The database update/creation did not succeed. " . + "The file ${filename} containing the following " . + "query failed:
${query}
" . + "The error message was: ${errstr}
" . + "All changes in that file have been reverted.") + } } $sth->finish();