Skip to content

Instantly share code, notes, and snippets.

@localdisk
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save localdisk/10945086 to your computer and use it in GitHub Desktop.
Save localdisk/10945086 to your computer and use it in GitHub Desktop.
Laravel 4.1.26 で users テーブルに remember_token カラムが必須になった
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddRememberTokenToUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function(Blueprint $table)
{
// SQLite って Not Null カラム追加時、デフォルト値がなかったら怒られるのなんなの?
$table->string('remember_token')->after('picture')->default('');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function(Blueprint $table)
{
$table->dropColumn('remember_token');
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment