<?php

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

class CreateEmployeeAllowanceCalculatorsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('employee_allowance_calculators', function (Blueprint $table) {
            $table->id();
            $table->integer('allowance_id')->nullable();
            $table->double('from')->default(0);
            $table->double('to')->default(0);
            $table->double('rate')->default(0);
            $table->double('minimum')->default(0);
            $table->double('maximum')->default(0);
            $table->integer('created_by')->nullable();
            $table->timestamps();
        });
    }

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