<?php

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

return new class extends Migration
{
    public function up()
    {
        Schema::table('tintorerias', function (Blueprint $table) {
            if (! Schema::hasColumn('tintorerias', 'descuentos_cobros')) {
                $table->decimal('descuentos_cobros', 12, 2)->default(0)->after('perdidas');
            }
        });
    }

    public function down()
    {
        Schema::table('tintorerias', function (Blueprint $table) {
            if (Schema::hasColumn('tintorerias', 'descuentos_cobros')) {
                $table->dropColumn('descuentos_cobros');
            }
        });
    }
};