<?php

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

class CreateUsersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('users', function(Blueprint $table)
		{
			$table->increments('id');
			$table->timestamps();
			$table->integer('site_id');
			$table->string('email', 191);
			$table->string('password', 191)->nullable();
			$table->string('remember_token', 100)->nullable();
			$table->boolean('active');
			$table->string('title', 191)->nullable();
			$table->string('firstname', 191);
			$table->string('lastname', 191);
			$table->integer('country_id');
			$table->string('address1', 191)->nullable();
			$table->string('address2', 191)->nullable();
			$table->string('city', 191)->nullable();
			$table->string('state', 191)->nullable();
			$table->string('postcode', 191)->nullable();
			$table->boolean('emailable')->default(1);
			$table->unique(['site_id','email']);
		});
	}


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

}
