<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('detail_test', function (Blueprint $table) {
            $table->uuid('id_detail_test')->primary();
            $table->uuid('id_soal');
            $table->uuid('id_test');
            $table->enum('jawaban', ['a', 'b', 'c', 'd', 'e', 'null']);
            $table->timestamps();

            // Foreign Key
            $table->foreign('id_test')->references('id_test')->on('test')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('detail_test');
    }
};
