<?php

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

class CreateBackendUsersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('backend_users', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('first_name', 50);
			$table->string('last_name', 50);
			$table->string('name', 100);
			$table->string('email', 100)->unique('backend_users_email_UNIQUE');
			$table->string('username', 20)->unique('backend_users_username');
			$table->string('password');
			$table->string('remember_token', 100)->nullable();
			$table->string('location', 100)->nullable();
			$table->string('contact_1', 40)->nullable();
			$table->string('contact_2', 40)->nullable();
			$table->string('role', 50)->nullable();
			$table->integer('type_id')->unsigned()->index('FK_backend_users_type');
			$table->timestamps();
			$table->softDeletes();
		});
	}


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

}
