Improve output
This commit is contained in:
parent
c3a48182fd
commit
fffc606d9a
1 changed files with 11 additions and 5 deletions
|
@ -61,19 +61,25 @@ class FixActionLogTimestamps extends Command
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($logs as $log) {
|
if ($this->dryrun) {
|
||||||
if (!$this->dryrun){
|
$this->info('DRY RUN. NOT ACTUALLY UPDATING LOGS.');
|
||||||
$this->line(vsprintf('Updating log id:%s from %s to %s', [$log->id, $log->created_at, $log->updated_at]));
|
}
|
||||||
|
|
||||||
|
foreach ($logs as $log) {
|
||||||
|
$this->line(vsprintf('Updating log id:%s from %s to %s', [$log->id, $log->created_at, $log->updated_at]));
|
||||||
|
|
||||||
|
if (!$this->dryrun) {
|
||||||
Model::withoutTimestamps(function () use ($log) {
|
Model::withoutTimestamps(function () use ($log) {
|
||||||
$log->created_at = $log->updated_at;
|
$log->created_at = $log->updated_at;
|
||||||
$log->saveQuietly();
|
$log->saveQuietly();
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
$this->line(vsprintf('DRYRUN: Updating log id:%s from %s to %s', [$log->id, $log->created_at, $log->updated_at]));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->dryrun) {
|
||||||
|
$this->info('DRY RUN. NO CHANGES WERE ACTUALLY MADE.');
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue