<?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('hcp_education', function (Blueprint $table) {
            $table->id('education_id'); 
            $table->unsignedBigInteger('hcp_id'); 
            $table->foreign('hcp_id')
          ->references('hcp_id')->on('hcp')
          ->onUpdate('cascade') 
          ->onDelete('cascade'); 

            $table->string('degree', 100);
            $table->string('specialization', 100)->nullable();
            $table->integer('awarded_year')->nullable();
        });
    }

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