<?php

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

class CreateGenAttendsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('gen_attends', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('emp_id')->nullable()->index();
			$table->integer('department_id')->nullable()->index();
			$table->integer('position_id')->nullable()->index();
			$table->enum('job_status', array('Probation 1 month','Probation 2 month','Probation 3 month','Contract 1 month','Contract 2 month','Contract 3 month','Contract 6 month','Contract 12 month','Contract 24 month','Permanent'))->nullable()->default('Permanent');
			$table->enum('staff_type', array('Office-Staff','Working','Foreigner'))->nullable()->default('Working');
			$table->integer('duty_station_id')->nullable()->index();
			$table->float('total_late', 10, 0)->nullable()->default(0);
			$table->float('absence', 10, 0)->nullable()->default(0);
			$table->float('absence_cal', 10, 0)->nullable()->default(0);
			$table->float('permission', 10, 0)->nullable()->default(0);
			$table->float('permission_cal', 10, 0)->nullable()->default(0);
			$table->float('total_day_cal', 10, 0)->nullable()->default(0);
			$table->float('ot_100', 10, 0)->nullable()->default(0);
			$table->float('ot_150', 10, 0)->nullable()->default(0);
			$table->float('ot_200', 10, 0)->nullable()->default(0);
			$table->float('ot_sun_100', 10, 0)->nullable()->default(0);
			$table->float('ot_sun_150', 10, 0)->nullable()->default(0);
			$table->float('ot_sun_200', 10, 0)->nullable()->default(0);
			$table->float('ot_hol_100', 10, 0)->nullable()->default(0);
			$table->float('ot_hol_150', 10, 0)->nullable()->default(0);
			$table->float('ot_hol_200', 10, 0)->nullable()->default(0);
			$table->date('from_date')->nullable();
			$table->date('to_date')->nullable();
			$table->integer('f_year')->nullable();
			$table->integer('f_month')->nullable();
			$table->integer('approve')->nullable()->default(0);
			$table->timestamps();
		});
	}


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

}
