<?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('danger_point_accidents', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('point_id')->nullable()->index('danger_point_accidents_point_id_foreign');
            $table->unsignedInteger('user_id')->nullable()->index('danger_point_accidents_user_id_foreign');
            $table->string('serial_number')->nullable();
            $table->date('accident_date')->nullable();
            $table->string('accident_date_fa', 10)->nullable();
            $table->unsignedTinyInteger('day')->nullable();
            $table->string('time')->nullable();
            $table->unsignedTinyInteger('accident_direction')->nullable();
            $table->unsignedTinyInteger('collision_type')->nullable();
            $table->longText('accident_factors')->nullable();
            $table->unsignedTinyInteger('accident_type')->nullable();
            $table->longText('accident_result')->nullable();
            $table->timestamps();
        });
    }

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