<?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('backend_data_pool', function (Blueprint $table) {
            // Add risk fields from backend.transactions
            $table->integer('risk_score')->nullable()->after('last_modified_at');
            $table->text('risk_level')->nullable()->after('risk_score');
            $table->text('risk_details_json')->nullable()->after('risk_level');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('backend_data_pool', function (Blueprint $table) {
            $table->dropColumn(['risk_score', 'risk_level', 'risk_details_json']);
        });
    }
};
