Refactor upgrade and verify commands.

This commit is contained in:
James Cole
2019-03-23 18:58:06 +01:00
parent 1b0be2a47e
commit ce30375341
31 changed files with 909 additions and 513 deletions

View File

@@ -52,7 +52,7 @@ class FixUnevenAmount extends Command
*/
public function handle(): int
{
$start = microtime(true);
$count = 0;
// get invalid journals
$journals = DB::table('transactions')
@@ -70,6 +70,9 @@ class FixUnevenAmount extends Command
$this->info('Amount integrity OK!');
}
$end = round(microtime(true) - $start, 2);
$this->info(sprintf('Verified amount integrity in %s seconds', $end));
return 0;
}
@@ -93,7 +96,7 @@ class FixUnevenAmount extends Command
$destination->amount = $amount;
$destination->save();
$this->line(sprintf('Corrected amount in transaction #%d', $param));
$this->line(sprintf('Corrected amount in transaction journal #%d', $param));
}
}