<?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('safety_and_privacy', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->double('lat', null, 0);
            $table->double('lon', null, 0);
            $table->unsignedTinyInteger('province_id')->nullable()->index('safety_and_privacy_province_id_foreign');
            $table->string('province_fa')->nullable();
            $table->unsignedSmallInteger('city_id')->nullable()->index('safety_and_privacy_city_id_foreign');
            $table->string('city_fa')->nullable();
            $table->unsignedBigInteger('edare_shahri_id')->nullable();
            $table->string('edare_shahri_name')->nullable();
            $table->string('recognize_picture')->nullable();
            $table->dateTime('activity_date_time')->nullable();
            $table->text('judiciary_document');
            $table->dateTime('judiciary_document_upload_date');
            $table->string('action_picture');
            $table->dateTime('action_picture_document_upload_date')->nullable();
            $table->unsignedInteger('operator_id')->nullable()->index('safety_and_privacy_operator_id_foreign');
            $table->string('operator_name')->nullable();
            $table->bigInteger('way_id')->nullable();
            $table->boolean('step')->nullable()->default(false);
            $table->string('step_fa')->nullable();
            $table->timestamps();
            $table->bigInteger('info_id')->nullable();
            $table->string('info_fa')->nullable();
        });
    }

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