2015-02-06 04:41:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
|
|
|
|
*
|
|
|
|
|
* Class CreateSessionTable
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
class CreateSessionTable extends Migration
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function down()
|
|
|
|
|
{
|
|
|
|
|
Schema::drop('sessions');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function up()
|
|
|
|
|
{
|
2016-02-05 15:41:40 +01:00
|
|
|
Schema::create(
|
|
|
|
|
'sessions', function ($table) {
|
2015-02-06 04:41:00 +01:00
|
|
|
$table->string('id')->unique();
|
2016-02-05 07:55:36 +01:00
|
|
|
$table->integer('user_id')->nullable();
|
|
|
|
|
$table->string('ip_address', 45)->nullable();
|
|
|
|
|
$table->text('user_agent')->nullable();
|
2015-02-06 04:41:00 +01:00
|
|
|
$table->text('payload');
|
|
|
|
|
$table->integer('last_activity');
|
2016-02-05 15:41:40 +01:00
|
|
|
}
|
|
|
|
|
);
|
2015-02-06 04:41:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|