<?php

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

class ClientsMigration extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('clients', function (Blueprint $table) {
            $table->increments('id');
            $table->string('company_name',20)->nullable();
            $table->string('company_type',100)->nullable();
            $table->string('username',20)->unique();
            $table->string('address')->nullable();
            $table->string('contact_no')->nullable();
            $table->string('email',100);
            $table->string('website')->nullable();
            $table->dateTime('expired_at')->nullable();
            $table->tinyInteger('status')->default(1);
            $table->tinyInteger('multiple_timezone')->default('0')->comments('0=no,1=yes');
            $table->timestampsTz();
        });
    }

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