<?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('wordling_words', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('game_id');
            $table->integer('secret_word_length')->default(5);
            $table->string('secret_word', 7)->default('aahit');
            $table->integer('max_attempts')->default(6);
            $table->enum('game_type', ['wordling_main', 'wordling_min', 'wordling_max'])->default('wordling_main');
            $table->enum('status', GameEnum::values())->default(GameEnum::ACTIVE);
            $table->date('game_date')->nullable();
            $table->timestamps();
        });
    }

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