From aa586a56777b6a552815a39f626d13f30bf7be79 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 8 Sep 2024 12:40:53 +0200 Subject: [PATCH] chore: Update docker cleanup schedule to run daily at midnight --- .../2024_09_07_185402_change_cleanup_schedule.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/database/migrations/2024_09_07_185402_change_cleanup_schedule.php b/database/migrations/2024_09_07_185402_change_cleanup_schedule.php index e2c24761c..ea8861f9b 100644 --- a/database/migrations/2024_09_07_185402_change_cleanup_schedule.php +++ b/database/migrations/2024_09_07_185402_change_cleanup_schedule.php @@ -2,6 +2,8 @@ use App\Models\ServerSetting; use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; return new class extends Migration { @@ -10,6 +12,10 @@ return new class extends Migration */ public function up(): void { + Schema::table('server_settings', function (Blueprint $table) { + $table->string('docker_cleanup_frequency')->default('0 0 * * *')->change(); + }); + $serverSettings = ServerSetting::all(); foreach ($serverSettings as $serverSetting) { if ($serverSetting->force_docker_cleanup && $serverSetting->docker_cleanup_frequency === '*/10 * * * *') { @@ -22,5 +28,10 @@ return new class extends Migration /** * Reverse the migrations. */ - public function down(): void {} + public function down(): void + { + Schema::table('server_settings', function (Blueprint $table) { + $table->string('docker_cleanup_frequency')->default('*/10 * * * *')->change(); + }); + } };