Remove skip(10) from activity_log and webhooks cleanup

This commit is contained in:
Andras Bacsai 2024-03-12 10:58:31 +01:00
parent 85c36df2a3
commit b3d15f91e4

View File

@ -36,7 +36,6 @@ public function handle()
} }
// Cleanup activity_log table // 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); $activity_log = DB::table('activity_log')->where('created_at', '<', now()->subDays($keep_days))->orderBy('created_at', 'desc')->skip(10);
$count = $activity_log->count(); $count = $activity_log->count();
echo "Delete $count entries from activity_log.\n"; echo "Delete $count entries from activity_log.\n";
@ -53,7 +52,7 @@ public function handle()
} }
// Cleanup webhooks table // 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(); $count = $webhooks->count();
echo "Delete $count entries from webhooks.\n"; echo "Delete $count entries from webhooks.\n";
if ($this->option('yes')) { if ($this->option('yes')) {