<?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', 'total_galones')) {
                $table->dropColumn('total_galones');
            }
        });
    }

    public function down(): void
    {
        Schema::table('cierres_turno', function (Blueprint $table) {
            if (!Schema::hasColumn('cierres_turno', 'total_galones')) {
                $table->decimal('total_galones', 12, 3)->nullable()->after('total_ventas');
            }
        });
    }
};
