Skip to content

Instantly share code, notes, and snippets.

@ziyahan
Created March 4, 2015 13:20
Show Gist options
  • Save ziyahan/112dcfb8d07705136c41 to your computer and use it in GitHub Desktop.
Save ziyahan/112dcfb8d07705136c41 to your computer and use it in GitHub Desktop.
User migrations
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function(Blueprint $table)
{
$table->increments('id');
$table->integer('role_id')->references('id')->on('roles');
$table->string('username',255)->unique();
$table->string('email')->unique();
$table->string('password', 60);
$table->boolean('isActive')->default(0);
$table->boolean('loggedIn')->default(0);
$table->rememberToken();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment