<?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::create('ai_healing_logs', function (Blueprint $table) {
            $table->id();
            $table->string('error_type')->nullable();
            $table->text('error_message');
            $table->longText('stack_trace')->nullable();
            $table->text('ai_diagnosis')->nullable();
            $table->string('action_taken')->nullable();
            $table->string('status')->default('pending'); // pending, diagnosing, resolved, failed
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('ai_healing_logs');
    }
};
