<?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('patient', function (Blueprint $table) {
            $table->id('patient_id')->autoIncrement();
            $table->text('unique_id')->unique();
            $table->string('first_name', 50);
            $table->string('middle_name', 50)->nullable();
            $table->string('disability', 50)->nullable();
            $table->string('vaccines', 500)->nullable();
            $table->string('last_name', 50);
            $table->text('address');
            $table->date('date_of_birth');
            $table->string('sex', 10);
            $table->string('patient_phone_num_country_code', 4)->nullable();
            $table->string('patient_phone_number', 20)->nullable();
            $table->string('patient_er_country_code', 4)->nullable();
            $table->string('patient_er_phone_number', 20)->nullable();
            $table->string('aadhar_card_num', 20)->nullable();
            $table->string('pan_card_num', 20)->nullable();
            $table->string('ssn_card_num', 20)->nullable();
            $table->integer('cibil_score')->nullable();
            $table->string('profession', 255)->nullable();
            $table->string('employment_status', 20)->nullable();
            $table->string('marital_status', 20)->nullable();
            $table->string('father_name', 255)->nullable();
            $table->string('mother_name', 255)->nullable();
            $table->integer('male_siblings')->nullable();
            $table->integer('female_siblings')->nullable();
            $table->boolean('consent_to_contact');
            $table->text('medical_billing_address')->nullable();
            $table->text('current_medications')->nullable();
            $table->text('previous_health_history')->nullable();
            $table->boolean('consent_to_treatment');
            $table->text('allergies')->nullable();
            $table->text('photo')->nullable();
            $table->text('drivers_license')->nullable();
            $table->text('aadhar_card')->nullable();
            $table->text('ssn_card')->nullable();
            $table->text('pan_card')->nullable();
            $table->string('qr_code')->nullable(); 
            $table->timestamps(); // Adds created_at and updated_at columns

        });
    }

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