<?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('cierres_turno', function (Blueprint $table) {
            if (Schema::hasColumn('cierres_turno', 'id_manguera')) {
                $table->dropColumn('id_manguera');
            }
        });
    }

    public function down(): void
    {
        Schema::table('cierres_turno', function (Blueprint $table) {
            if (!Schema::hasColumn('cierres_turno', 'id_manguera')) {
                $table->unsignedBigInteger('id_manguera')->nullable()->after('id_turno');
            }
        });
    }
};
