<?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('solicitudes', function (Blueprint $table) {
            $table->dropColumn('tipo_falla');
        });
        
        Schema::table('solicitudes', function (Blueprint $table) {
            $table->json('tipo_falla')->nullable();
            $table->string('numero_activo')->nullable();
            $table->time('hora_reporte')->nullable();
        });
    }

    public function down(): void
    {
        Schema::table('solicitudes', function (Blueprint $table) {
            $table->dropColumn(['tipo_falla', 'numero_activo', 'hora_reporte']);
        });

        Schema::table('solicitudes', function (Blueprint $table) {
            $table->string('tipo_falla')->nullable();
        });
    }
};
