<?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_observeds', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('AutoID')->nullable();
            $table->string('Title')->nullable();
            $table->string('StartTime')->nullable();
            $table->string('EndTime')->nullable();
            $table->string('StartDate')->nullable();
            $table->string('EndDate')->nullable();
            $table->string('StartTime_DateTime')->nullable();
            $table->string('StartTime_DateTime_fa')->nullable();
            $table->string('EndTime_DateTime')->nullable();
            $table->string('fk_RegisteredEventMessage')->nullable();
            $table->string('fk_Country')->nullable();
            $table->string('ProvinceName')->nullable();
            $table->string('fk_Province')->nullable();
            $table->string('fk_Town')->nullable();
            $table->string('TownName')->nullable();
            $table->string('lat')->nullable();
            $table->string('lng')->nullable();
            $table->string('XLAM')->nullable();
            $table->string('YLAM')->nullable();
            $table->string('WeatherName')->nullable();
            $table->string('fk_Weather')->nullable();
            $table->string('EventTypeTitle')->nullable();
            $table->string('fk_EventType')->nullable();
            $table->string('FeatureTypeTitle')->nullable();
            $table->string('fk_FeatureType')->nullable();
            $table->text('Description')->nullable();
            $table->string('MobileForSendEventSms')->nullable();
            $table->unsignedTinyInteger('rms_province_id')->nullable()->index('road_observeds_rms_province_id_foreign');
            $table->unsignedSmallInteger('rms_city_id')->nullable()->index('road_observeds_rms_city_id_foreign');
            $table->boolean('rms_status')->default(false);
            $table->string('rms_start_latlng')->nullable();
            $table->string('rms_end_latlng')->nullable();
            $table->text('rms_description')->nullable();
            $table->timestamps();
            $table->string('updated_at_fa')->nullable();
            $table->bigInteger('observed_way_id')->nullable();
            $table->bigInteger('handling_way_id')->nullable();
            $table->dateTime('rms_last_activity')->nullable();
            $table->string('rms_last_activity_fa', 100)->nullable();
            $table->string('image_before', 255)->nullable();
            $table->string('image_after', 255)->nullable();
            $table->unsignedBigInteger('edarate_shahri_id')->nullable()->index('road_observeds_edarate_shahri_foreign');
            $table->unsignedTinyInteger('province_id')->nullable()->index('road_observeds_province_id_foreign');
            $table->unsignedSmallInteger('city_id')->nullable()->index('road_observeds_fk');
            $table->string('province_fa')->nullable();
            $table->string('city_fa')->nullable();
            $table->string('refer_description', 255)->nullable();
            $table->string('restore_description', 255)->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();
            $table->string('supervisor_name')->nullable();
        });
    }

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