<?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::table('casos', function (Blueprint $table) {
            $table->text('direccion_inspeccion')->nullable()->after('fecha_inspeccion');
            $table->decimal('lat_inspeccion', 10, 7)->nullable()->after('direccion_inspeccion');
            $table->decimal('lng_inspeccion', 10, 7)->nullable()->after('lat_inspeccion');
            $table->boolean('confirmo_llegada')->default(false)->after('lng_inspeccion');
            $table->timestamp('confirmo_llegada_at')->nullable()->after('confirmo_llegada');
        });
    }

    public function down(): void
    {
        Schema::table('casos', function (Blueprint $table) {
            $table->dropColumn(['direccion_inspeccion', 'lat_inspeccion', 'lng_inspeccion', 'confirmo_llegada', 'confirmo_llegada_at']);
        });
    }
};
