diff --git a/app/src/Command/TransmogrifyCommand.php b/app/src/Command/TransmogrifyCommand.php
index 43651d127..79d869cbb 100644
--- a/app/src/Command/TransmogrifyCommand.php
+++ b/app/src/Command/TransmogrifyCommand.php
@@ -689,27 +689,14 @@ public function execute(Arguments $args, ConsoleIo $io) {
$this->cliLogPercentage($tally, $count);
}
}
-
- // Run any post processing functions for the table.
-
- if(!empty($this->tables[$t]['postTable'])) {
- $p = $this->tables[$t]['postTable'];
-
- $this->$p();
- }
-
+
+ // Log warning and error count.
+ $io->out("(Warnings: " . $warns . ")");
+ $io->out("(Errors: " . $err . ")");
+
+ // Reset sequence to next value after current max.
$max = $this->outconn->fetchOne('SELECT MAX(id) FROM ' . $t);
$max++;
- $stdout_msg = "(New max: " . $max . ")";
- if($warns > 0) {
- $stdout_msg .= "(Warnings: " . $warns . ")";
- }
- if($err > 0) {
- $stdout_msg .= "(Errors: " . $err . ")";
- }
-
- $io->out($stdout_msg);
-
$this->io->info("Resetting sequence for $t to $max");
// Strictly speaking we should use prepared statements, but we control the
@@ -721,6 +708,13 @@ public function execute(Arguments $args, ConsoleIo $io) {
$outsql = "ALTER SEQUENCE " . $t . "_id_seq RESTART WITH " . $max;
}
$this->outconn->executeQuery($outsql);
+
+ // Run any post processing functions for the table.
+ if(!empty($this->tables[$t]['postTable'])) {
+ $p = $this->tables[$t]['postTable'];
+
+ $this->$p();
+ }
}
}