<?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('labors', 'name_en')) {
            Schema::table('labors', function (Blueprint $t) {
                $t->string('name_en')->nullable()->after('name_ru');
            });
        }
    }

    public function down(): void
    {
        if (Schema::hasColumn('labors', 'name_en')) {
            Schema::table('labors', function (Blueprint $t) {
                $t->dropColumn('name_en');
            });
        }
    }
};
