<?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
    {
        if (!Schema::hasTable('leadership_ranks')) {
            return;
        }

        Schema::table('leadership_ranks', function (Blueprint $table) {
            $table->integer('need_level2_members')->default(0)->after('include_level2_verified');
        });
    }

    public function down(): void
    {
        if (!Schema::hasTable('leadership_ranks') || !Schema::hasColumn('leadership_ranks','need_level2_members')) {
            return;
        }

        Schema::table('leadership_ranks', function (Blueprint $table) {
            $table->dropColumn('need_level2_members');
        });
    }
};
