Created
January 6, 2016 11:35
-
-
Save 4lun/3f67b5d2ef4df564549a to your computer and use it in GitHub Desktop.
Upgrade to Laravel 5.2: Migration for sessions table
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\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class AddAdditionalSessionColumnsForLaravel52 extends Migration | |
{ | |
/** | |
* Run the migrations. | |
*/ | |
public function up() | |
{ | |
Schema::table('sessions', function (Blueprint $table) { | |
$table->integer('user_id')->nullable(); | |
$table->string('ip_address', 45)->nullable(); | |
$table->text('user_agent')->nullable(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
*/ | |
public function down() | |
{ | |
Schema::table('sessions', function (Blueprint $table) { | |
$table->dropColumn('user_id'); | |
$table->dropColumn('ip_address'); | |
$table->dropColumn('user_agent'); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment