<?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('patientnew', 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('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->binary('photo')->nullable();
            $table->binary('drivers_license')->nullable();
            $table->binary('aadhar_card')->nullable();
            $table->binary('ssn_card')->nullable();
            $table->binary('pan_card')->nullable();
            $table->timestamps(); 
        });
    }

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