<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('form_histories', function (Blueprint $table) {
            $table->id();
            $table->foreignId('causer_id')->constrained('users');
            $table->string('module');
            $table->string('event');
            $table->string('description');
            $table->json('attribute_changes')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('form_histories');
    }
};
