<?php

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

class CreateLoansTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('loans', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->nullable();
            $table->double('interest_rate')->nullable();
            $table->double('no_of_months')->nullable();
            $table->double('amount')->nullable();
            $table->double('net_amount')->nullable();
            $table->double('installment')->nullable();
            $table->string('loan_form')->nullable();
            $table->enum('is_initialize', ['0','1'])->default('0');
            $table->enum('is_recycle', ['0','1','2'])->default('0');
            $table->timestamps();
        });
    }

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