<?php

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

class UserWiseExchangeMigration extends Migration
{
    public function up()
    {
        Schema::create('user_wise_exchange', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->integer('client_id')->unsigned();
            $table->date('holiday_date');
            $table->date('desire_date');
            $table->string('message')->nullable();
            $table->string('reply')->nullable();
            $table->integer('created_by')->unsigned();
            $table->integer('updated_by')->unsigned();
            $table->dateTime('action_at')->nullable();
            $table->integer('action_by')->unsigned()->nullable();
            $table->tinyInteger('status')->default('0'); //pending
            $table->tinyInteger('viewed')->default('0'); //not seen
            $table->timestampsTz();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        DB::statement('SET FOREIGN_KEY_CHECKS=0');
        Schema::dropIfExists('user_wise_exchange');
        DB::statement('SET FOREIGN_KEY_CHECKS=1');
    }
}
