<?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('products', function (Blueprint $table) {
            $table->string('shipping_time')->default('7-15 days'); // Required
            $table->string('delivery_via')->nullable(); // e.g., DHL, Sea Freight
            $table->text('refund_policy')->nullable(); 
            $table->json('customization_options')->nullable(); // Dynamic array
            $table->json('specifications')->nullable(); // Dynamic key-value pairs
        });
    }

    public function down(): void
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn([
                'shipping_time', 
                'delivery_via', 
                'refund_policy', 
                'customization_options', 
                'specifications'
            ]);
        });
    }
};