Implement VM deletion functionality and update related services; add confirmation check and logging
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user