<?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('player_rankings', function (Blueprint $table) {
            $table->unsignedBigInteger('pk_count')->default(0)->after('reputation');
            $table->index('pk_count');
        });
    }

    public function down(): void
    {
        Schema::table('player_rankings', function (Blueprint $table) {
            $table->dropIndex(['pk_count']);
            $table->dropColumn('pk_count');
        });
    }
};
