<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        if (!Schema::hasTable('leadership_ranks') || !Schema::hasColumn('leadership_ranks', 'count_start_at')) {
            return;
        }

        DB::table('leadership_ranks')->update([
            'count_start_at' => now(),
        ]);
    }

    public function down(): void
    {
        // intentionally left blank
    }
};
