<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('patient_insurances', function (Blueprint $table) {
            $table->id('insurance_id'); 
            $table->unsignedBigInteger('patient_id'); 
            $table->string('insurance_company', 100)->nullable(); 
            $table->string('insurance_number', 50)->nullable(); 
            $table->binary('insurance_card')->nullable(); 
            
            
            $table->foreign('patient_id')->references('patient_id')->on('patient')->onUpdate('no action')->onDelete('no action');
        });
    }

  
    public function down(): void
    {
        Schema::dropIfExists('patient_insurances');
    }
};
