use SL::Common;
use SL::DBUpgrade2::Base;
use SL::DBUtils;
+use SL::System::Process;
use strict;
$params{path_suffix} ||= '';
$params{schema} ||= '';
- $params{path} ||= "sql/Pg-upgrade2" . $params{path_suffix};
+ $params{path} ||= SL::System::Process->exe_dir . "/sql/Pg-upgrade2" . $params{path_suffix};
map { $self->{$_} = $params{$_} } keys %params;
$dbh->begin_work;
# setup dbup_ export vars & run script
- my $old_dbh = SL::DB->client->dbh($dbh);
my %dbup_myconfig = map { ($_ => $::form->{$_}) } qw(dbname dbuser dbpasswd dbhost dbport dbconnect);
my $result = eval {
SL::DBUpgrade2::Base::execute_script(
my $error = $EVAL_ERROR;
- $::form->set_standard_dbh($old_dbh);
-
$dbh->rollback if 1 != ($result // -1);
return $error if $self->{return_on_error} && (1 != ($result // -1));
=back
A Perl script can actually implement queries that fail while
-continueing the process by handling the transaction itself, e.g. with
+continuing the process by handling the transaction itself, e.g. with
the following function:
sub do_query {