<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('rate_my_pays', function (Blueprint $table) {
            // Remove salary-related columns that duplicate job_experience data
            $table->dropColumn([
                'base_salary',
                'bonus', 
                'equity',
                'benefits',
                'currency',
                'total_compensation'
            ]);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('rate_my_pays', function (Blueprint $table) {
            $table->decimal('base_salary', 12, 2)->after('payslip_path');
            $table->decimal('bonus', 12, 2)->default(0)->after('base_salary');
            $table->decimal('equity', 12, 2)->default(0)->after('bonus');
            $table->text('benefits')->nullable()->after('equity');
            $table->string('currency', 3)->default('NGN')->after('benefits');
            $table->decimal('total_compensation', 12, 2)->after('currency');
        });
    }
};
