<?php

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

class CreateSecUserTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('sec_user', function(Blueprint $table)
		{
			$table->bigInteger('id', true);
			$table->bigInteger('version')->default(0);
			$table->boolean('account_expired')->default(0);
			$table->boolean('account_locked')->default(0);
			$table->string('email', 75)->unique('sec_user_email_key');
			$table->boolean('enabled')->default(1);
			$table->string('password');
			$table->boolean('password_expired')->default(0);
			$table->string('username')->unique('sec_user_username_key');
			$table->bigInteger('setor_id')->nullable();
			$table->string('primeiro_nome')->nullable();
			$table->string('ultimo_nome')->nullable();
			$table->boolean('ativo')->nullable()->default(1);
			$table->boolean('redefinir_senha')->nullable()->default(0);
		});
	}


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

}
