<?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('perhitungans', function (Blueprint $table) {
            $table->id();
            $table->string('session_id')->nullable()->index();
            $table->string('nama_pewaris');
            $table->bigInteger('harta_total');
            $table->json('input_ahli_waris');
            $table->json('hasil');
            $table->integer('asal_masalah');
            $table->enum('kondisi', ['normal', 'aul', 'radd'])->default('normal');
            $table->string('ip_address')->nullable();
            $table->timestamps();
        });
    }

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