<?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('appraisal_goals', function (Blueprint $table) {
            $table->string('criteria_outstanding')->nullable()->default('100%')->change();
            $table->string('criteria_excellent')->nullable()->default('90%')->change();
            $table->string('criteria_very_good')->nullable()->default('80%')->change();
            $table->string('criteria_good')->nullable()->default('70%')->change();
            $table->string('criteria_fair')->nullable()->default('60%')->change();
            $table->string('criteria_poor')->nullable()->default('50%')->change();
        });
    }

    public function down(): void
    {
        Schema::table('appraisal_goals', function (Blueprint $table) {
            $table->decimal('criteria_outstanding', 5, 2)->nullable()->default(100)->change();
            $table->decimal('criteria_excellent', 5, 2)->nullable()->default(90)->change();
            $table->decimal('criteria_very_good', 5, 2)->nullable()->default(80)->change();
            $table->decimal('criteria_good', 5, 2)->nullable()->default(70)->change();
            $table->decimal('criteria_fair', 5, 2)->nullable()->default(60)->change();
            $table->decimal('criteria_poor', 5, 2)->nullable()->default(50)->change();
        });
    }
};
