<?php

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

class CreateRoadObservedsTable 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('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();
            $table->foreign('rms_province_id')
                ->references('id')
                ->on('provinces');
            $table->unsignedSmallInteger('rms_city_id')->nullable();
            $table->foreign('rms_city_id')
                ->references('id')
                ->on('cities');
            $table->boolean('rms_status')->default(0);
            $table->string('rms_start_latlng')->nullable();
            $table->string('rms_end_latlng')->nullable();
            $table->text('rms_description')->nullable();
            $table->timestamps();
        });
    }

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