Last active
August 29, 2015 13:59
-
-
Save localdisk/10945086 to your computer and use it in GitHub Desktop.
Laravel 4.1.26 で users テーブルに remember_token カラムが必須になった
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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