<?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_health_history', function (Blueprint $table) {
            $table->id('health_history_id'); 
            $table->unsignedBigInteger('patient_id'); 
            $table->string('health_condition', 255)->nullable(); 
            $table->string('hcp_notes', 255)->nullable(); 
            $table->date('diagnosis_date')->nullable(); 
           
            $table->foreign('patient_id')->references('patient_id')->on('patient')->onUpdate('no action')->onDelete('no action');
        });
    }

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