<?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('recommendations', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('hcp_id'); 
            $table->foreignId('patient_id')->constrained('patient', 'patient_id')->onDelete('cascade');
            $table->text('notes'); // Storing recommendations
            $table->date('date')->nullable();
            $table->foreign('hcp_id')->references('hcp_id')->on('hcp')->onUpdate('no action')->onDelete('no action');
            $table->timestamps();
        });
    }
 
    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('recommendations');
    }
};
  