<?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::hasColumn('coaches', 'english_name')) {
            return;
        }

        Schema::table('coaches', function (Blueprint $table) {
            $table->string('english_name', 150)->nullable()->after('name')->comment('英文姓名');
        });
    }

    public function down(): void
    {
        if (! Schema::hasColumn('coaches', 'english_name')) {
            return;
        }

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