<?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('batch_kpi_snapshots', function (Blueprint $table) {
            $table->decimal('stage_fcr_target', 12, 3)->nullable()->after('stage_fcr_real');
            $table->decimal('stage_fcr_gap', 12, 3)->nullable()->after('stage_fcr_target');
            $table->decimal('post_split_fcr_target', 12, 3)->nullable()->after('post_split_fcr_real');
            $table->decimal('post_split_fcr_gap', 12, 3)->nullable()->after('post_split_fcr_target');
        });
    }

    public function down(): void
    {
        Schema::table('batch_kpi_snapshots', function (Blueprint $table) {
            $table->dropColumn([
                'stage_fcr_target',
                'stage_fcr_gap',
                'post_split_fcr_target',
                'post_split_fcr_gap',
            ]);
        });
    }
};
