Skip to content

Commit

Permalink
Add indexes to sessions table (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyhethers authored Sep 25, 2023
1 parent 23ba829 commit f731cba
Showing 1 changed file with 23 additions and 0 deletions.
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']);
});
}
};

0 comments on commit f731cba

Please sign in to comment.