Files
cachet-docker/app/database/migrations/2015_01_05_203341_CreateUsersTable.php
2015-01-05 21:23:09 +00:00

44 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('username')->unique();
$table->string('password');
$table->string('remember_token')->nullable()->default(null)->unique();
$table->string('email');
$table->string('api_key');
$table->boolean('active')->default(1);
$table->tinyInteger('level')->default(2);
$table->timestamps();
$table->index('remember_token');
$table->index('active');
$table->unique('api_key');
$table->unique('email');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}