mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-20 04:23:16 +00:00
refactor: move buildpack cleanup logic to model lifecycle hooks
Move buildpack switching cleanup from Livewire component to Application model's boot lifecycle. This improves separation of concerns and ensures cleanup happens consistently regardless of how the buildpack change is triggered. Also clears Dockerfile-specific data when switching away from dockerfile buildpack. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
d5813fd286
commit
0540b2eae5
5 files changed
+379
-14
No files matched your search
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// Clear dockerfile fields for applications not using dockerfile buildpack
|
||||
DB::table('applications')
|
||||
->where('build_pack', '!=', 'dockerfile')
|
||||
->update([
|
||||
'dockerfile' => null,
|
||||
'dockerfile_location' => null,
|
||||
'dockerfile_target_build' => null,
|
||||
'custom_healthcheck_found' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// No rollback needed - we're cleaning up corrupt data
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user