<?php

use App\Enums\GameEnum;
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('hexling_words', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('game_id');
            $table->string('root_word')->default('eamplk');
            $table->string('center_letter')->default('x');
            $table->json('secret_words');
            $table->integer('total_levels')->default(5);
            $table->integer('total_points')->default(0);
            $table->enum('status', GameEnum::values())->default(GameEnum::ACTIVE);
            $table->date('game_date');
            $table->timestamps();
        });
    }

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