<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Elimina el campo centro_costo de la tabla users.
     * El sistema usa Gerencia y Unidad en su lugar.
     */
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('centro_costo');
        });
    }

    /**
     * Restaura el campo en caso de rollback.
     */
    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('centro_costo', 50)->nullable()->after('departamento_id');
        });
    }
};
