<?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
    {
        Schema::table('tenant_user_profiles', function (Blueprint $table) {
            $table->string('worker_type', 20)->default('employee')->after('employee_status')
                ->comment('근로자유형: employee(사원), business_income(사업소득자)');
            $table->index(['tenant_id', 'worker_type'], 'idx_tenant_worker_type');
        });
    }

    public function down(): void
    {
        Schema::table('tenant_user_profiles', function (Blueprint $table) {
            $table->dropIndex('idx_tenant_worker_type');
            $table->dropColumn('worker_type');
        });
    }
};
