<?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('employees') && ! Schema::hasColumn('employees', 'additional_notes')) {
            Schema::table('employees', function (Blueprint $table) {
                $table->text('additional_notes')->nullable()->after('tax_payer_id');
            });
        }
    }

    public function down(): void
    {
        if (Schema::hasTable('employees') && Schema::hasColumn('employees', 'additional_notes')) {
            Schema::table('employees', function (Blueprint $table) {
                $table->dropColumn('additional_notes');
            });
        }
    }
};
