<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Store EmployeeReferenceId from doctor_db.xlsx (and similar sheets) for matching MRs.
     */
    public function up(): void
    {
        Schema::table('mrs', function (Blueprint $table) {
            $table->string('employee_reference_id', 80)->nullable()->after('id');
            $table->index('employee_reference_id');
        });
    }

    public function down(): void
    {
        Schema::table('mrs', function (Blueprint $table) {
            $table->dropIndex(['employee_reference_id']);
            $table->dropColumn('employee_reference_id');
        });
    }
};
