<?php

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

class CreateAbrarPlanProjectsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('abrar_plan_projects', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->unsignedTinyInteger('province_id');
            $table->foreign('province_id')
                ->references('id')
                ->on('provinces');
            $table->string('province_name')->nullable();
            $table->unsignedSmallInteger('city_id')->nullable();
            $table->foreign('city_id')
                ->references('id')
                ->on('cities');
            $table->string('city_name')->nullable();
            $table->text('axis_name')->nullable();
            $table->string('axis_length')->nullable();
            $table->string('project_type')->nullable();
            $table->unsignedTinyInteger('project_status')->nullable();
            $table->string('project_status_progress')->nullable();
            $table->text('project_status_description')->nullable();
            $table->string('project_status_date')->nullable();
            $table->string('project_start_latlng')->nullable();
            $table->string('project_end_latlng')->nullable();
            $table->string('project_length')->nullable();
            $table->timestamps();
        });
    }

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