<?php

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

class CreateEmpLeaveTotalTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('emp_leave_total', function(Blueprint $table)
		{

			$table->bigInteger('id', true)->unsigned();
			$table->integer('emp_id')->nullable()->index();
			$table->integer('leave_year')->nullable()->default(0);
			$table->float('special_leave', 10, 0)->nullable()->default(0);
			$table->float('sick_leave', 10, 0)->nullable()->default(0);
			$table->float('maternity_leave', 10, 0)->nullable()->default(0);
			$table->float('annual_leave', 10, 0)->default(0);
			$table->float('unpaid_leave', 10, 0)->nullable()->default(0);
			$table->float('other_leave', 10, 0)->nullable()->default(0);

            $table->float('casual_leave', 10, 0)->nullable()->default(0);
            $table->float('medical_leave', 10, 0)->nullable()->default(0);
            $table->float('earned_leave', 10, 0)->nullable()->default(0);

			$table->timestamps();
		});
	}


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

}
