<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('order_items', function (Blueprint $table) {
            $table->boolean('starch')->default(false)->after('color_type');
            $table->decimal('starch_price', 8, 2)->default(0)->after('starch');
        });

        Schema::table('orders', function (Blueprint $table) {
            $table->boolean('express_delivery')->default(false)->after('packaging_preference');
            $table->decimal('express_delivery_price', 8, 2)->default(0)->after('express_delivery');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('order_items', function (Blueprint $table) {
            $table->dropColumn(['starch', 'starch_price']);
        });

        Schema::table('orders', function (Blueprint $table) {
            $table->dropColumn(['express_delivery', 'express_delivery_price']);
        });
    }
};
