fix(backups): preserve existing volume backup timeouts

Change only the default timeout for new volume backups without modifying existing schedules.
This commit is contained in:
Andras Bacsai
2026-08-18 15:30:59 +02:00
parent 050107a41d
commit b075693274
2 changed files with 2 additions and 7 deletions
@@ -2,17 +2,12 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
DB::table('scheduled_volume_backups')
->where('timeout', 3600)
->update(['timeout' => 36000]);
Schema::table('scheduled_volume_backups', function (Blueprint $table) {
$table->unsignedInteger('timeout')->default(36000)->change();
});
+2 -2
View File
@@ -61,7 +61,7 @@ it('allows large volume backups to run for ten hours by default', function () {
->and(config('queue.connections.redis.retry_after'))->toBeGreaterThan(config('horizon.defaults.s6.timeout'));
});
it('upgrades existing default volume backup timeouts without changing custom timeouts', function () {
it('changes the default volume backup timeout without changing existing timeouts', function () {
$team = Team::factory()->create();
[$application, $defaultVolume] = createVolumeBackupApplication($team);
$customVolume = LocalPersistentVolume::create([
@@ -84,7 +84,7 @@ it('upgrades existing default volume backup timeouts without changing custom tim
$migration = require database_path('migrations/2026_08_15_000000_increase_default_volume_backup_timeout.php');
$migration->up();
expect($defaultBackup->fresh()->timeout)->toBe(36000)
expect($defaultBackup->fresh()->timeout)->toBe(3600)
->and($customBackup->fresh()->timeout)->toBe(7200);
});