<?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('badges', function (Blueprint $table) {
            $table->id();
            $table->string('name')->unique();               // "First Blood"
            $table->string('description');
            $table->string('icon_url')->nullable();
            $table->string('condition_key');                // "predictions_count" | "streak_days" | "correct_predictions"
            $table->unsignedInteger('condition_value');     // threshold value e.g. 1, 5, 10
            $table->timestamps();
        });
    }

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