<?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::create('contract_customers', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->foreignUuid('contract_id')->constrained('contracts')->cascadeOnDelete();
            $table->foreignUuid('customer_id')->constrained('customers')->cascadeOnDelete();
            $table->string('role')->default('CHỦ SH 1'); // Đồng sở hữu
            $table->integer('transfer_order')->default(0);
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('contract_customers'); }
};