<?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('patient_employments', function (Blueprint $table) {
            $table->id('employment_id'); 
            $table->unsignedBigInteger('patient_id'); 
            $table->integer('current_company')->nullable(); 
            $table->string('company_name', 100)->nullable(); 
            $table->text('company_address')->nullable(); 
            $table->string('company_phone', 20)->nullable(); 
            
            $table->foreign('patient_id')->references('patient_id')->on('patient')->onUpdate('no action')->onDelete('no action');
        });
    }

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