<?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->engine = 'InnoDB';
			$table->increments('id');
			$table->string('first_name', 20);
			$table->string('surnames', 40);
			$table->string('email', 50)->unique();
			$table->string('alternate_email', 50)->unique()->nullable();
			$table->string('password', 255);
			$table->integer('role');
			$table->integer('school_id')->nullable();
			$table->integer('program_id')->nullable();
			$table->rememberToken();
			$table->timestamps();
		});
	}


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

}
