<?php

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

class CreateHrHolidaysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('hr_holidays', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->string('description')->nullable();
            $table->timestamp('start_date');
            $table->timestamp('end_date');
            $table->integer('total_days')->default(1);
            $table->boolean('paid')->default(true);
            $table->enum('status', ['pending', 'approved', 'declined', 'cancelled'])->default('pending');
            $table->string('ip_address', 32)->nullable();
            $table->integer('created_by')->unsigned();
            $table->integer('updated_by')->unsigned();
            $table->timestamps();
        });
    }

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