Implement VM deletion functionality and update related services; add confirmation check and logging

This commit is contained in:
baodev0
2026-07-17 09:14:26 +07:00
parent 5cf7411d3e
commit abc12b71ef
12 changed files with 320 additions and 161 deletions
@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropForeign(['customer_id']);
$table->unsignedBigInteger('customer_id')->nullable()->change();
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('set null');
});
}
public function down(): void
{
Schema::table('services', function (Blueprint $table) {
$table->dropForeign(['customer_id']);
$table->unsignedBigInteger('customer_id')->nullable(false)->change();
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade');
});
}
};