<?php

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

class CreateAccident251PointsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('accident_251_points', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->unsignedTinyInteger('province_id')->nullable();
            $table->foreign('province_id')
                ->references('id')
                ->on('provinces');
            $table->unsignedSmallInteger('city_id')->nullable();
            $table->foreign('city_id')
                ->references('id')
                ->on('cities');
            $table->unsignedSmallInteger('accident_point_id')->nullable();
            $table->foreign('accident_point_id')
                ->references('id')
                ->on('accident_points');
            $table->string('lat');
            $table->string('lng');
            $table->string('province')->nullable();
            $table->string('axis_name')->nullable();
            $table->string('axis_start')->nullable();
            $table->string('axis_end')->nullable();
            $table->string('native_name')->nullable();
            $table->text('operation')->nullable();
            $table->string('target')->nullable();
            $table->string('cost')->nullable();
            $table->string('progress')->nullable();
            $table->string('end_date')->nullable();
            $table->text('actions')->nullable();
            $table->timestamps();
        });
    }

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