<?php

declare(strict_types=1);

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use TechnoArtisan\FilamentCms\Database\BaseMigration;

return new class extends BaseMigration {
    protected const string TABLE = 'fcms_contact_request_errors';

    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create(self::TABLE, function (Blueprint $table): void {
            $this->basicTableSetup($table); // engine, charset, collation

            $table->increments('id'); // INT (10) unsigned

            $table->string('session_id', 255);
            $table->longText('exception');
            $table->longText('request');
            $table->longText('session');
            $table->longText('validated_data')->nullable();

            $table->timestamps();

            // Indexes
            $table->index('session_id', 'IDX_session_id');
        });
    }
};
