<?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::table('reward_badges', function (Blueprint $table) {
            $table->string('color', 20)->default('#00FF9D')->after('icon');
            $table->string('rarity', 20)->default('common')->after('color'); // common, rare, epic, legendary
            $table->integer('level')->default(1)->after('rarity');
            $table->boolean('is_active')->default(true)->after('level');
            $table->string('unlock_condition')->nullable()->after('description');
        });
    }

    public function down(): void
    {
        Schema::table('reward_badges', function (Blueprint $table) {
            $table->dropColumn(['color', 'rarity', 'level', 'is_active', 'unlock_condition']);
        });
    }
};
