hydra-init: show SQL commands being executed

This commit is contained in:
Eelco Dolstra 2012-04-15 18:34:32 +02:00
parent bf757f687d
commit 80705c8a20

View file

@ -51,7 +51,12 @@ for (my $n = $schemaVersion; $n < $maxSchemaVersion; $n++) {
my @statements = $sql_splitter->split($schema);
eval {
$dbh->begin_work;
$dbh->do($_) foreach @statements;
sub run {
my ($stm) = @_;
print STDERR "executing SQL statement: $stm\n";
$dbh->do($_);
}
run($_) foreach @statements;
$db->resultset('SchemaVersion')->update({version => $m});
$dbh->commit;
};