-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add indexes to sessions table (#978)
- Loading branch information
1 parent
23ba829
commit f731cba
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
modules/system/database/migrations/2023_09_24_000028_Db_System_Sessions_Indexes.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
use Winter\Storm\Database\Schema\Blueprint; | ||
use Winter\Storm\Support\Str; | ||
|
||
return new class extends \Winter\Storm\Database\Updates\Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::table('sessions', function ($table) { | ||
$table->index(['last_activity']); | ||
$table->index(['user_id']); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table('sessions', function ($table) { | ||
$table->dropIndex(['last_activity']); | ||
$table->dropIndex(['user_id']); | ||
}); | ||
} | ||
}; |