diff --git a/app/Console/Commands/CleanupDatabase.php b/app/Console/Commands/CleanupDatabase.php index a0adc8b36..2ccb76529 100644 --- a/app/Console/Commands/CleanupDatabase.php +++ b/app/Console/Commands/CleanupDatabase.php @@ -57,6 +57,14 @@ class CleanupDatabase extends Command $application_deployment_queues->delete(); } + // Cleanup scheduled_task_executions table + $scheduled_task_executions = DB::table('scheduled_task_executions')->where('created_at', '<', now()->subDays($keep_days))->orderBy('created_at', 'desc'); + $count = $scheduled_task_executions->count(); + echo "Delete $count entries from scheduled_task_executions.\n"; + if ($this->option('yes')) { + $scheduled_task_executions->delete(); + } + // Cleanup webhooks table $webhooks = DB::table('webhooks')->where('created_at', '<', now()->subDays($keep_days)); $count = $webhooks->count();