<?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::table('casos', function (Blueprint $table) {
            $table->string('aseguradora_razon_social')->nullable()->after('aseguradora_id');
            $table->string('aseguradora_ruc')->nullable()->after('aseguradora_razon_social');
            $table->string('aseguradora_ciudad')->nullable()->after('aseguradora_ruc');
            $table->string('aseguradora_ejecutivo_nombre')->nullable()->after('aseguradora_ciudad');

            $table->string('broker_razon_social')->nullable()->after('broker_id');
            $table->string('broker_nro_reclamo')->nullable()->after('broker_razon_social');
            $table->string('broker_fecha_siniestro')->nullable()->after('broker_nro_reclamo');

            $table->string('particular_nombre')->nullable()->after('tipo_contrato');
            $table->string('particular_email')->nullable()->after('particular_nombre');
            $table->string('particular_telefono')->nullable()->after('particular_email');
            $table->string('particular_identificacion')->nullable()->after('particular_telefono');
            $table->string('particular_tipo_identificacion')->nullable()->after('particular_identificacion');
            $table->string('particular_ciudad')->nullable()->after('particular_tipo_identificacion');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('casos', function (Blueprint $table) {
            $table->dropColumn([
                'aseguradora_razon_social',
                'aseguradora_ruc',
                'aseguradora_ciudad',
                'aseguradora_ejecutivo_nombre',
                'broker_razon_social',
                'broker_nro_reclamo',
                'broker_fecha_siniestro',
                'particular_nombre',
                'particular_email',
                'particular_telefono',
                'particular_identificacion',
                'particular_tipo_identificacion',
                'particular_ciudad',
            ]);
        });
    }
};
