<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('accident_damage', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('accident_id')->nullable()->index('accident_damage_ibfk_1');
            $table->unsignedInteger('damage_id')->nullable()->index('accident_damage_ibfk_2');
            $table->integer('value')->nullable();
            $table->bigInteger('amount')->nullable();
            $table->string('unit', 50)->nullable();
        });
    }

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