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

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