From b3d15f91e49fc28820326fa53d2351a1f66f292d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 12 Mar 2024 10:58:31 +0100 Subject: [PATCH] Remove skip(10) from activity_log and webhooks cleanup --- app/Console/Commands/CleanupDatabase.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Console/Commands/CleanupDatabase.php b/app/Console/Commands/CleanupDatabase.php index 0c8f9b884..495b365ee 100644 --- a/app/Console/Commands/CleanupDatabase.php +++ b/app/Console/Commands/CleanupDatabase.php @@ -36,7 +36,6 @@ class CleanupDatabase extends Command } // Cleanup activity_log table - // but keep the last 10 $activity_log = DB::table('activity_log')->where('created_at', '<', now()->subDays($keep_days))->orderBy('created_at', 'desc')->skip(10); $count = $activity_log->count(); echo "Delete $count entries from activity_log.\n"; @@ -53,7 +52,7 @@ class CleanupDatabase extends Command } // Cleanup webhooks table - $webhooks = DB::table('webhooks')->where('created_at', '<', now()->subDays($keep_days))->orderBy('created_at', 'desc')->skip(10); + $webhooks = DB::table('webhooks')->where('created_at', '<', now()->subDays($keep_days)); $count = $webhooks->count(); echo "Delete $count entries from webhooks.\n"; if ($this->option('yes')) {