<?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::create('simulation_questions', function (Blueprint $table) {
            $table->id();
            $table->foreignId('interview_category_id')->constrained('interview_categories')->onDelete('cascade');
            $table->text('question');
            $table->json('expected_keywords')->nullable()->comment('Cevapda bulunması gereken anahtar kelimeler');
            $table->text('sample_answer')->nullable()->comment('Örnek cevap');
            $table->unsignedInteger('points')->default(20)->comment('Sorunun puan değeri');
            $table->unsignedInteger('order')->default(0);
            $table->timestamps();
            $table->softDeletes();
            $table->index('interview_category_id');
            $table->index('order');
        });
    }

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