<?php

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

/**
 * PRC-1143 — konsolide şema: `client_product_config_option_values` tablosunun TAM tanımı (tek dosya).
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::create('client_product_config_option_values', function (Blueprint $t) {
            $t->id();
            $t->unsignedInteger('product_id');
            $t->unsignedInteger('group_id')->nullable();
            $t->unsignedInteger('option_id');
            $t->string('value', 255);
            $t->timestamp('created_at')->nullable();
            $t->timestamp('updated_at')->nullable();
            $t->index('group_id', 'idx_cpcov_group');
            $t->index('option_id', 'idx_cpcov_option');
        });
    }

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