<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('_b_b_openings', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('office_name')->nullable();
            $table->string('deputy_district')->nullable();
            $table->string('province_fa')->nullable();
            $table->unsignedTinyInteger('province_id')->nullable()->index('b_b_openings_province_id_foreign');
            $table->string('activity')->nullable();
            $table->string('plan_id')->nullable();
            $table->string('plan_fa')->nullable();
            $table->string('project_title')->nullable();
            $table->string('unit')->nullable();
            $table->double('amount', null, 0)->nullable()->default(0);
            $table->double('national_consumer_credit', null, 0)->nullable();
            $table->double('province_consumer_credit', null, 0)->nullable();
            $table->timestamps();
        });
    }

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