<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('harim_divarkeshi', function (Blueprint $table) {
            $table->id();
            $table->string('dabirkhaneh_number');
            $table->timestamp('nameh_date');
            $table->string('nameh_date_fa', 10);
            $table->string('marjae_pasokh')->nullable();
            $table->tinyInteger('motaghazi_is_legal_id')->default(1);
            $table->string('motaghazi_is_legal', 5);/// 1 haghighi 2 hoghoghi

            $table->tinyInteger('motaghazi_type_id')->nullable();
            $table->string('motaghazi_type')->nullable(); // 1 dolati 2 khososi

            $table->string('motaghazi_firstname');
            $table->string('motaghazi_lastname');

            $table->string('national_id')->nullable(); ///  code melli
            $table->string('shenase_melli')->nullable();
            $table->string('tel_number')->nullable();
            $table->string('mobile_number')->nullable();
            $table->string('address');

            $table->tinyInteger('edare_kol_id');
            $table->string('edare_kol');

            $table->tinyInteger('edare_shahri_id');
            $table->string('edare_shahri');

            $table->tinyInteger('rah_type_id');
            $table->string('rah_type');

            $table->tinyInteger('name_mehvar_id')->nullable();
            $table->string('name_mehvar_fa');

            $table->string('mizan_harim');
            $table->string('arze_navar')->nullable();
            $table->tinyInteger('samt_id'); // smat 1 chap 2 rast
            $table->string('samt'); // smat 1 chap 2 rast
            $table->string('kilometr');
            $table->string('lat');
            $table->string('lon');
            $table->string('zone');
            $table->tinyInteger('karbari_type_id');
            $table->string('karbari_type');
            $table->string('tarh_title');
            $table->string('masahat_zirbana')->nullable();
            $table->tinyInteger('ehdasat_type_id');
            $table->string('ehdasat_type');
            $table->string('divarkeshi_distance')->nullable();
            $table->string('mostahadesat_distance')->nullable();
            $table->tinyInteger('mahale_ejra_id')->nullable();
            $table->string('mahale_ejra')->nullable();
            $table->tinyInteger('traffic_id');
            $table->string('traffic');
            $table->tinyInteger('vaziat_eghtesadi_id')->nullable();
            $table->string('vaziat_eghtesadi')->nullable();
            $table->tinyInteger('has_access_id');
            $table->string('has_access');
            $table->string('shomare_estelam_harim')->nullable();
            $table->integer('max_month');
            $table->integer('max_day');
            $table->string('shomare_tahaodname')->nullable();
            $table->string('shomare_daftarkhaneh')->nullable();
            $table->string('description')->nullable();
            $table->string('ronevesht')->nullable();
            $table->timestamps();
        });
    }

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