From e03da3760efc9be99c6808fd67c6a3e09ee1f2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Wed, 30 Sep 2020 01:20:29 +0200 Subject: [PATCH] Add index at user_auth_token.user_id column (#27908) --- pkg/services/sqlstore/migrations/user_auth_token_mig.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/services/sqlstore/migrations/user_auth_token_mig.go b/pkg/services/sqlstore/migrations/user_auth_token_mig.go index 9794b7a78c7..990d549002a 100644 --- a/pkg/services/sqlstore/migrations/user_auth_token_mig.go +++ b/pkg/services/sqlstore/migrations/user_auth_token_mig.go @@ -23,10 +23,13 @@ func addUserAuthTokenMigrations(mg *Migrator) { Indices: []*Index{ {Cols: []string{"auth_token"}, Type: UniqueIndex}, {Cols: []string{"prev_auth_token"}, Type: UniqueIndex}, + {Cols: []string{"user_id"}, Type: IndexType}, }, } mg.AddMigration("create user auth token table", NewAddTableMigration(userAuthTokenV1)) mg.AddMigration("add unique index user_auth_token.auth_token", NewAddIndexMigration(userAuthTokenV1, userAuthTokenV1.Indices[0])) mg.AddMigration("add unique index user_auth_token.prev_auth_token", NewAddIndexMigration(userAuthTokenV1, userAuthTokenV1.Indices[1])) + + mg.AddMigration("add index user_auth_token.user_id", NewAddIndexMigration(userAuthTokenV1, userAuthTokenV1.Indices[2])) }