<?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_points', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->unsignedTinyInteger('province_id')->nullable()->index('accident_points_province_id_foreign');
            $table->unsignedSmallInteger('city_id')->nullable()->index('accident_points_city_id_foreign');
            $table->string('lat');
            $table->string('lng');
            $table->string('priority')->nullable();
            $table->string('code')->nullable();
            $table->string('province')->nullable();
            $table->string('axis_name')->nullable();
            $table->string('axis_type')->nullable();
            $table->string('axis_start')->nullable();
            $table->string('axis_end')->nullable();
            $table->string('native_name')->nullable();
            $table->string('distance')->nullable();
            $table->string('geometric_desc')->nullable();
            $table->text('operation')->nullable();
            $table->string('target')->nullable();
            $table->string('cost')->default('0');
            $table->string('progress')->default('0');
            $table->string('end_date')->nullable();
            $table->text('actions')->nullable();
            $table->timestamps();
        });
    }

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