<?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('daily_accidents', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('province_id')->nullable();
            $table->string('province_fa')->nullable();
            $table->string('axis_name', 200)->nullable();
            $table->boolean('axis_type')->nullable();
            $table->string('axis_type_fa', 200)->nullable();
            $table->string('axis_start', 200)->nullable();
            $table->string('axis_end', 200)->nullable();
            $table->string('distance_axis_start', 20)->nullable();
            $table->string('local_name', 200)->nullable();
            $table->decimal('lat', 12, 10)->nullable();
            $table->decimal('lng', 12, 10)->nullable();
            $table->boolean('way_geometri')->nullable();
            $table->string('way_geometri_fa', 80)->nullable();
            $table->string('police_serial', 50)->nullable();
            $table->integer('avarage_speed')->nullable();
            $table->integer('legal_speed')->nullable();
            $table->dateTime('accident_date')->nullable();
            $table->time('accident_time')->nullable();
            $table->string('day_of_the_week', 50)->nullable();
            $table->boolean('direction')->nullable();
            $table->string('direction_fa', 60)->nullable();
            $table->integer('number_of_injured')->nullable();
            $table->integer('number_of_died')->nullable();
            $table->boolean('weather_condition')->nullable();
            $table->string('weather_condition_fa', 100)->nullable();
            $table->text('first_image')->nullable();
            $table->text('second_image')->nullable();
            $table->text('police_file')->nullable();
            $table->boolean('collision_type')->nullable();
            $table->string('collision_type_fa', 100)->nullable();
            $table->boolean('participants_heavy_vehicle')->nullable();
            $table->boolean('participants_light_vehicle')->nullable();
            $table->boolean('participants_bicycle')->nullable();
            $table->boolean('accident_type')->nullable();
            $table->string('accident_type_fa', 50)->nullable();
            $table->boolean('increase_damage_reasons_feqdan_jodakonnande_dar_miyane_rah')->nullable();
            $table->boolean('increase_damage_reasons_naqs_ya_adam_kefayat_hefaze_miyani')->nullable();
            $table->boolean('increase_damage_reasons_naqs_ya_adam_kefayat_narde_pol')->nullable();
            $table->boolean('increase_damage_reasons_naqs_ya_adam_kefayat')->nullable();
            $table->boolean('increase_damage_reasons_naqs_dar_naheye_enteqali')->nullable();
            $table->boolean('increase_damage_reasons_mane_solb_bedone_hefaz')->nullable();
            $table->boolean('increase_damage_reasons_sar_azad_hefaz')->nullable();
            $table->boolean('increase_damage_reasons_shirvani_tond_ya_partgah')->nullable();
            $table->boolean('accident_reason_dor_monaseb_dar_qus')->nullable();
            $table->boolean('accident_reason_saraziri_tond')->nullable();
            $table->boolean('accident_reason_nabod_dar_khat_sebqat_dar_sarbalaye')->nullable();
            $table->boolean('accident_reason_mantaqe_ba_rizesh_az_divar')->nullable();
            $table->boolean('accident_reason_mantaqe_ba_afzayesh_nagahani')->nullable();
            $table->boolean('accident_reason_kahesh_na_monaseb_tedad')->nullable();
            $table->boolean('accident_reason_mantaqe_ba_obor_heyvanat_ahli')->nullable();
            $table->boolean('accident_reason_mantaqe_ba_tadakhol_terafiki')->nullable();
            $table->boolean('accident_reason_arze_kam_savare_ro')->nullable();
            $table->boolean('accident_reason_mantaqe_meh_gir')->nullable();
            $table->boolean('accident_reason_adam_roshanaye_zarori_dar_noqte')->nullable();
            $table->boolean('accident_reason_tabdil_na_monaseb_noe_rah')->nullable();
            $table->boolean('accident_reason_oftadegi_dar_labe_asphalt')->nullable();
            $table->boolean('accident_reason_naqs_dar_ashkarsazi_navahi')->nullable();
            $table->boolean('accident_reason_mahal_na_monaseb_dastrasi')->nullable();
            $table->boolean('accident_reason_roye_na_monaseb')->nullable();
            $table->boolean('accident_reason_naqs_dar_ashkar_sazi_shrayet_khas')->nullable();
            $table->boolean('accident_reason_hendese_na_monaseb_vorodi_va_khoroji')->nullable();
            $table->boolean('accident_reason_adam_rayat_fasele_tooli')->nullable();
            $table->boolean('accident_reason_naqs_dar_alayem_ekhtari_va_entezami')->nullable();
            $table->boolean('accident_reason_qus_ofoqi_dar_saraziri_tond')->nullable();
            $table->boolean('accident_reason_adam_rayat_obor')->nullable();
            $table->boolean('accident_reason_naqs_dar_alayem_pish_agahi')->nullable();
            $table->boolean('accident_reason_qarar_gire_qus_ofoqi')->nullable();
            $table->boolean('accident_reason_adam_rayat_sebghat_mojaz')->nullable();
            $table->boolean('accident_reason_did_na_kafi')->nullable();
            $table->boolean('accident_reason_qus_tond_qaem')->nullable();
            $table->boolean('accident_reason_adam_rayat_sorat_mojaz')->nullable();
            $table->boolean('accident_reason_ebham_dar_masir')->nullable();
            $table->boolean('accident_reason_qus_tond_ofoghi')->nullable();
            $table->integer('state')->nullable()->default(2);
            $table->string('state_fa', 50)->nullable()->default('در حال بررسی');
            $table->string('message', 300)->nullable();
            $table->dateTime('state_updated_at')->nullable();
            $table->bigInteger('checker_user_id')->nullable();
            $table->string('way_id', 255)->nullable();
            $table->dateTime('created_at')->nullable();
            $table->dateTime('updated_at')->nullable();
            $table->integer('excell')->nullable()->default(1);
            $table->string('time_temp', 255)->nullable();
            $table->integer('develop')->nullable()->default(0);
        });
    }

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