Also update orphans.

This commit is contained in:
James Cole 2022-07-03 08:24:04 +02:00
parent d215510124
commit 34e006d87b
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -152,7 +152,12 @@ class DeleteOrphanedTransactions extends Command
$this->info('No orphaned journals.');
}
if($count > 0) {
$this->info('Found %d orphaned journal(s).', $count);
$this->info(sprintf('Found %d orphaned journal(s).', $count));
TransactionJournal
::leftJoin('transaction_groups', 'transaction_journals.transaction_group_id', 'transaction_groups.id')
->whereNotNull('transaction_groups.deleted_at')
->whereNull('transaction_journals.deleted_at')
->update(['transaction_journals.deleted_at', now()]);
}
}
}