<?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('_road_patrol_projects', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id')->nullable()->index('road_patrol_projects_user_id_foreign');
            $table->decimal('start_lat', 12, 10);
            $table->decimal('start_lng', 12, 10);
            $table->decimal('end_lat', 12, 10);
            $table->decimal('end_lng', 12, 10);
            $table->string('project_distance');
            $table->timestamps();
            $table->bigInteger('province_id')->nullable();
            $table->string('province_fa')->nullable();
            $table->bigInteger('city_id')->nullable();
            $table->string('city_fa')->nullable();
            $table->bigInteger('start_way_id')->nullable();
            $table->bigInteger('end_way_id')->nullable();
            $table->string('user_name')->nullable();
            $table->unsignedSmallInteger('status')->nullable();
            $table->string('status_fa', 100)->nullable();
            $table->unsignedInteger('supervisor_id')->nullable();
            $table->text('supervisor_description')->nullable();
            $table->timestamp('supervising_time')->nullable();
        });
    }

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