forked from lix-project/hydra
hydra-init: show SQL commands being executed
This commit is contained in:
parent
bf757f687d
commit
80705c8a20
|
@ -51,7 +51,12 @@ for (my $n = $schemaVersion; $n < $maxSchemaVersion; $n++) {
|
||||||
my @statements = $sql_splitter->split($schema);
|
my @statements = $sql_splitter->split($schema);
|
||||||
eval {
|
eval {
|
||||||
$dbh->begin_work;
|
$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});
|
$db->resultset('SchemaVersion')->update({version => $m});
|
||||||
$dbh->commit;
|
$dbh->commit;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue