<?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->integer('backend_user_id')->unsigned()->nullable()->index('FK_users_1');
			$table->string('email');
			$table->string('first_name')->nullable();
			$table->string('last_name')->nullable();
			$table->enum('gender', array('m','f','not_defined'))->nullable()->default('not_defined');
			$table->string('language_id', 2)->nullable();
			$table->integer('terms')->unsigned()->nullable()->default(0);
			$table->enum('user_status', array('submited','donated','both','none'))->default('none');
			$table->string('ip', 45)->nullable()->default('');
			$table->timestamps();
		});
	}


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

}
