<?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('contact_message_attachments', function (Blueprint $table) {
            // pending → processing → completed | failed | skipped | manual
            $table->string('extraction_status', 16)->nullable()->after('size');
            $table->longText('extracted_text')->nullable()->after('extraction_status');
        });
    }

    public function down(): void
    {
        Schema::table('contact_message_attachments', function (Blueprint $table) {
            $table->dropColumn(['extraction_status', 'extracted_text']);
        });
    }
};
