<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddMoreIndexesToRefreshTokens extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('refresh_tokens', function (Blueprint $collection) {
            $collection->index('user_id');
            $collection->index('client_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('refresh_tokens', function (Blueprint $collection) {
            $collection->dropIndex('user_id');
            $collection->dropIndex('client_id');
        });
    }
}

Add client & user indexes to refresh tokens.
Add client & user indexes to refresh tokens.

This will allow us to look up active refresh tokens by user or by
client.
