<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('game_lists', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->index()->unsigned();
            $table->integer('game_id')->index()->unsigned();
            $table->enum('ownership', [1, 2, 3, 4])->nullable()->default(null);
            $table->enum('status', [1, 2, 3, 4, 5, 6])->index()->default(1);
            $table->enum('rating', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])->index()->nullable()->default(null);
            $table->enum('priority', ['Low', 'Medium', 'High'])->nullable()->default(null);
            $table->enum('difficulty', ['Easy', 'Medium', 'Hard', 'Extremely Hard'])->nullable()->default(null);
            $table->enum('hours_played', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13])->nullable()->default(null);
            $table->enum('replay_value', [1, 2, 3, 4, 5])->nullable()->default(null);
            $table->timestamp('start_date')->nullable()->default(null);
            $table->timestamp('finish_date')->nullable()->default(null);
            $table->enum('is_replaying', ['Y', 'N'])->nullable()->default('N');
            $table->text('notes')->nullable()->default(null);
            $table->ipAddress('ip_address')->nullable()->default(null);
            $table->timestamps();
            $table->softDeletes();
        });
    }

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