<?php

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

/**
 * PRC-1143 — konsolide şema: `product_config_fields` tablosunun TAM tanımı (tek dosya).
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::create('product_config_fields', function (Blueprint $t) {
            $t->id();
            $t->unsignedInteger('group_id');
            $t->enum('type', ['number','select','checkboxgroup'])->default('select');
            $t->json('values')->nullable();
            $t->integer('order')->default(1);
            $t->boolean('hidden')->default(0);
            $t->boolean('is_required')->default(0);
            $t->timestamp('created_at')->nullable();
            $t->timestamp('updated_at')->nullable();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('product_config_fields');
    }
};
