<?php

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

class CreateBBOpeningsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('b_b_openings', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('car_name')->nullable();
            $table->string('deputy_district')->nullable();
            $table->string('province_fa')->nullable();
            $table->unsignedTinyInteger('province_id')->nullable();
            $table->foreign('province_id')
                  ->references('id')
                  ->on('provinces');
            $table->string('activity')->nullable();
            $table->text('plan_id')->nullable();
            $table->text('plan_fa')->nullable();
            $table->string('project_title')->nullable();
            $table->text('unit')->nullable();
            $table->float('amount')->nullable();
            $table->mediumInteger('national_consumer_credit')->nullable();
            $table->mediumInteger('province_consumer_credit')->nullable();
            $table->timestamps();
        });
    }

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