fix(restarts): reset legacy restart limits during migration

Normalize existing resources with the old restart limit defaults so restart limits remain opt-in.
This commit is contained in:
Andras Bacsai
2026-09-15 13:28:50 +02:00
parent ab30f95ad9
commit 113a2f229d
2 changed files with 21 additions and 1 deletions
@@ -220,7 +220,12 @@ it('makes restart limits opt in for new application resources', function () {
expect($migration)
->toContain("['applications', 'application_previews', 'service_applications']")
->toContain("integer('max_restart_count')->default(0)->change()")
->not->toContain('->update(');
->toContain('public $withinTransaction = false;')
->toContain("->where('max_restart_count', 10)")
->toContain('->chunkById(5000')
->toContain("->whereIn('id', \$resources->pluck('id'))")
->toContain("'max_restart_count' => 0")
->toContain("'restart_limit_reached' => false");
$applicationSettings = file_get_contents(app_path('Livewire/Project/Application/Advanced.php'));
$serviceSettings = file_get_contents(app_path('Livewire/Project/Service/Index.php'));