my @upgradescripts = map { $controls->{$_}->{applied} = 0; $controls->{$_} } @order;
- my $dbh = $opt_auth_db ? connect_auth()->dbconnect : $form->dbconnect_noauto(\%myconfig);
- $dbh->{AutoCommit} = 0;
+ my $dbh = $opt_auth_db ? connect_auth()->dbconnect : SL::DB->client->dbh;
$dbh->{PrintWarn} = 0;
$dbh->{PrintError} = 0;
# apply upgrade
print "Applying upgrade $control->{file}\n";
-
- if ($file_type eq "sql") {
- $dbupgrader->process_query($dbh, "sql/Pg-upgrade2/$control->{file}", $control);
- } else {
- $dbupgrader->process_perl_script($dbh, "sql/Pg-upgrade2/$control->{file}", $control);
- }
+ $dbupgrader->process_file($dbh, "sql/Pg-upgrade2/$control->{file}", $control);
}
$dbh->disconnect unless $opt_auth_db;
sub dump_applied {
my @results;
- my $dbh = $opt_auth_db ? connect_auth()->dbconnect : $form->dbconnect_noauto(\%myconfig);
+ my $dbh = $opt_auth_db ? connect_auth()->dbconnect : SL::DB->client->dbh;
$dbh->{AutoCommit} = 0;
$dbh->{PrintWarn} = 0;
sub dump_unapplied {
my @results;
- my $dbh = $opt_auth_db ? connect_auth()->dbconnect : $form->dbconnect_noauto(\%myconfig);
+ my $dbh = $opt_auth_db ? connect_auth()->dbconnect : SL::DB->client->dbh;
$dbh->{PrintWarn} = 0;
$dbh->{PrintError} = 0;