<?php

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

/*
 * Oculi now collects attacks below its enrichment threshold as "minor" - the size is recorded but no
 * breakdowns are, so the attack has a peak yet no report worth opening. The table says which with a
 * `report` flag, and the mirror has to carry it so the report queue can tell the two apart.
 */
return new class extends Migration
{

    public function up()
    {
        Schema::table('mitigation_attack_state', function (Blueprint $table) {
            $table->boolean('report')->default(false)->after('ready');
        });
    }

    public function down()
    {
        Schema::table('mitigation_attack_state', function (Blueprint $table) {
            $table->dropColumn('report');
        });
    }
};
