<?php

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

class CreateAuthLogsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('auth_logs', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('ip');
			$table->integer('user_id')->nullable();
			$table->enum('state', array('success', 'failed'))->default('success');
			$table->timestamps();

			$table->engine = 'MyISAM';
		});
	}

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

}
