<?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('medical_declarations', function (Blueprint $table) {
            $table->id();
            $table->foreignId('staff_id')->constrained('staff')->cascadeOnDelete();
            $table->date('declaration_date');
            $table->boolean('has_pre_existing_conditions')->default(false);
            $table->text('conditions_detail')->nullable();
            $table->boolean('is_fit_for_duty')->default(true);
            $table->string('doctor_name')->nullable();
            $table->string('clinic_name')->nullable();
            $table->timestamps();
        });
    }

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