<?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('factory_products', function (Blueprint $table) {
            $table->string('machine_name')->nullable()->after('name');
        });

        Schema::table('factory_product_recipes', function (Blueprint $table) {
            $table->boolean('is_dough')->default(false)->after('quantity');
        });
    }

    public function down(): void
    {
        Schema::table('factory_product_recipes', function (Blueprint $table) {
            $table->dropColumn('is_dough');
        });

        Schema::table('factory_products', function (Blueprint $table) {
            $table->dropColumn('machine_name');
        });
    }
};
