From 6dd3ab2ec90fe4bca1368c8ae626c7af31a89130 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 3 Apr 2025 12:56:46 -0700 Subject: [PATCH] Exit early if no logs found --- .../Commands/FixBulkAccessoryCheckinActionLogEntries.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php b/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php index 70d0a4460..8879430c6 100644 --- a/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php +++ b/app/Console/Commands/FixBulkAccessoryCheckinActionLogEntries.php @@ -41,6 +41,11 @@ class FixBulkAccessoryCheckinActionLogEntries extends Command // Logs that were improperly timestamped should have created_at in the 1970s $logs = Actionlog::whereYear('created_at', '1970')->get(); + if ($logs->isEmpty()) { + $this->info('No logs found with incorrect timestamps.'); + return 0; + } + $this->info('Found ' . $logs->count() . ' logs with incorrect timestamps:'); $this->table(