$params{path_suffix} ||= '';
$params{schema} ||= '';
- $params{path} = "sql/Pg-upgrade2" . $params{path_suffix};
+ $params{path} ||= "sql/Pg-upgrade2" . $params{path_suffix};
map { $self->{$_} = $params{$_} } keys %params;
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();
my ($self, $dbh, $filename, $version_or_control) = @_;
- my %form_values = map { $_ => $::form->{$_} } qw(dbconnect dbdefault dbhost dbname dboptions dbpasswd dbport dbupdate dbuser login template_object version);
+ my %form_values = %$::form;
$dbh->begin_work;