Update the sessions table (#1030)
* Update the sessions table * Add index on user_id
This commit is contained in:
@@ -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
|
// Overrides config/session.php
|
||||||
'session' => [
|
'session' => [
|
||||||
'default' => 'file',
|
'default' => 'database',
|
||||||
'lifetime' => 60 * 24, # 24 hours
|
'lifetime' => 60 * 24, # 24 hours
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user