mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-12 15:53:46 -04:00
fix(scheduled-tasks): drop leftover failure_count and auto_disabled_at
Instances that ran a since-removed migration from an earlier version of task auto-disable still have these columns. The current implementation uses consecutive_failures, failing_since, and disabled_reason instead. The migration checks that each column exists before dropping it.
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Instances that ran a removed migration of an earlier version of task auto-disable still have these columns.
|
||||
* The current version uses consecutive_failures, failing_since, and disabled_reason.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
foreach (['failure_count', 'auto_disabled_at'] as $column) {
|
||||
if (Schema::hasColumn('scheduled_tasks', $column)) {
|
||||
Schema::table('scheduled_tasks', function (Blueprint $table) use ($column) {
|
||||
$table->dropColumn($column);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user