Update the sessions table (#1030)
* Update the sessions table * Add index on user_id
This commit is contained in:
parent
be9b698f14
commit
447d02bd4f
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Bring the sessions table in line with the latest
|
||||
*/
|
||||
class UpdateSessionsTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->change()->primary();
|
||||
$table->index('user_id');
|
||||
$table->index('last_activity');
|
||||
});
|
||||
}
|
||||
}
|
@ -107,7 +107,7 @@ return [
|
||||
|
||||
// Overrides config/session.php
|
||||
'session' => [
|
||||
'default' => 'file',
|
||||
'default' => 'database',
|
||||
'lifetime' => 60 * 24, # 24 hours
|
||||
],
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user