<?php

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

/**
 * Migration auto-generated by Sequel Pro Laravel Export
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
 */
class CreateUsersTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('users', function (Blueprint $table) {
			$table->increments('id');
			$table->string('name', 255)->nullable();
			$table->string('email', 95)->nullable();
			$table->string('password', 255)->nullable();
			$table->string('user_type', 255)->nullable();
			$table->integer('group_id')->nullable();
			$table->string('api_token', 60)->unique();
			$table->rememberToken();
			$table->nullableTimestamps();
			$table->softDeletes();

			$table->unique('email', 'users_email_unique')->nullable();

		});
	}

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