<?php

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

return new class extends Migration
{
    /**
     * PRC-786 — Ürün custom field'larına önceden-dolu varsayılan değer.
     * checkbox → '0'/'1', dropdown → seçenek value'su, text/textarea → serbest.
     */
    public function up(): void
    {
        Schema::table('product_custom_fields', function (Blueprint $table) {
            $table->string('default_value', 500)->nullable()->after('dropdown_options');
        });
    }

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