<?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('sale_items', function (Blueprint $table): void {
            $table->decimal('return_cotton', 12, 3)->default(0)->after('weight_price');
            $table->decimal('cotton_price', 12, 2)->default(0)->after('return_cotton');
        });
    }

    public function down(): void
    {
        Schema::table('sale_items', function (Blueprint $table): void {
            $table->dropColumn(['return_cotton', 'cotton_price']);
        });
    }
};
