<?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('cancelleds', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('examination_id');  // لربط الفحص
            $table->enum('status', ['في انتظار التاكيد','الغاء'])->default('الغاء'); // حالة الاستلام
            $table->timestamps();

            // إنشاء علاقة بين الفحوصات و استقبال الفحص
            $table->foreign('examination_id')->references('id')->on('examinations')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('cancelleds');
    }
};
