<?php

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

class CreateCampsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('camps', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id');
            $table->foreign('user_id')
                  ->references('id')
                  ->on('users');
            $table->unsignedTinyInteger('province_id')->nullable();
            $table->foreign('province_id')
                  ->references('id')
                  ->on('provinces');
            $table->string('province_fa')->nullable();
            $table->string('axis_name')->nullable();
            $table->unsignedTinyInteger('axis_type')->nullable();
            $table->string('axis_type_fa')->nullable();
            $table->unsignedTinyInteger('blockage_cause')->nullable();
            $table->string('blockage_cause_fa')->nullable();
            $table->unsignedTinyInteger('blockage_type')->nullable();
            $table->unsignedTinyInteger('prediction_time')->nullable();
            $table->string('prediction_time_fa')->nullable();
            $table->string('blockage_type_fa')->nullable();
            $table->string('blockage_length')->nullable();
            $table->string('blockage_damage_money')->nullable();
            $table->string('blockage_damage_count')->nullable();
            $table->string('blockage_damage_lower_6_count')->nullable();
            $table->string('blockage_damage_higher_6_count')->nullable();
            $table->string('active_cars_count')->nullable();
            $table->string('active_rahdar_count')->nullable();
            $table->string('block_axis_desc')->nullable();
            $table->unsignedTinyInteger('is_open')->nullable();
            $table->string('is_open_type')->nullable();
            $table->string('is_open_type_fa')->nullable();
            $table->json('cities_id')->nullable();
            $table->string('city_1_fa')->nullable();
            $table->string('city_2_fa')->nullable();
            $table->string('city_3_fa')->nullable();
            $table->string('start_latlng')->nullable();
            $table->string('end_latlng')->nullable();
            $table->string('submited_at')->nullable();
            $table->string('is_open_at')->nullable();
            $table->timestamps();
        });
    }

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