sub process_file {
my ($self, $dbh, $filename, $version_or_control) = @_;
- return $filename =~ m/sql$/ ? $self->process_query( $dbh, $filename, $version_or_control)
- : $self->process_perl_script($dbh, $filename, $version_or_control);
+ my $result = $filename =~ m/sql$/ ? $self->process_query( $dbh, $filename, $version_or_control)
+ : $self->process_perl_script($dbh, $filename, $version_or_control);
+
+ $::lxdebug->log_time("DB upgrade script '${filename}' finished");
+
+ return $result;
}
sub unapplied_upgrade_scripts {
print $self->{form}->parse_html_template("dbupgrade/header", { dbname => $::auth->{DB_config}->{db} });
+ $::lxdebug->log_time("DB upgrades commencing");
+
foreach my $control (@unapplied_scripts) {
$::lxdebug->message(LXDebug->DEBUG2(), "Applying Update $control->{file}");
print $self->{form}->parse_html_template("dbupgrade/upgrade_message2", $control);
$self->process_file($dbh, "sql/Pg-upgrade2-auth/$control->{file}", $control);
}
+ $::lxdebug->log_time("DB upgrades finished");
+
print $self->{form}->parse_html_template("dbupgrade/footer", { is_admin => 1 }) if $called_from_admin;
return 1;
my @upgradescripts = $dbupdater->unapplied_upgrade_scripts($dbh);
+ $::lxdebug->log_time("DB upgrades commencing");
+
foreach my $control (@upgradescripts) {
# Apply upgrade. Control will only return to us if the upgrade has
# been applied correctly and if the update has not requested user
$dbupdater->process_file($dbh, "sql/Pg-upgrade2/$control->{file}", $control);
}
+ $::lxdebug->log_time("DB upgrades finished");
+
$dbh->disconnect;
}