DBUpgrade2: may_fail für reine sql Queries auch honorieren.
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 30 Mar 2016 09:29:34 +0000 (11:29 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 30 Mar 2016 09:29:34 +0000 (11:29 +0200)
SL/DBUpgrade2.pm

index eb366e1..840a1dd 100644 (file)
@@ -186,11 +186,13 @@ sub process_query {
             return $errstr // '<unknown database error>' 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:<br>${query}<br>" .
-                           "The error message was: ${errstr}<br>" .
-                           "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:<br>${query}<br>" .
+                             "The error message was: ${errstr}<br>" .
+                             "All changes in that file have been reverted.")
+            }
           }
           $sth->finish();