From 20b0076672f5f3874a27b9975526ba6dd48ebceb Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 25 Oct 2016 02:43:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D1=8F=D0=B5=D0=BC=20?= =?UTF-8?q?=D1=83=D0=BD=D0=B8=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=B8=D0=BD=D0=B4=D0=B5=D0=BA=D1=81=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8F=20client=5Ftoken=20=D0=B2=20=D1=82?= =?UTF-8?q?=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B5=20minecraft=5Faccess=5Fkey?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authserver/models/AuthenticationForm.php | 2 +- .../m161024_234121_remove_client_token_index.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 console/migrations/m161024_234121_remove_client_token_index.php diff --git a/api/modules/authserver/models/AuthenticationForm.php b/api/modules/authserver/models/AuthenticationForm.php index edbc6c7..5a0f65b 100644 --- a/api/modules/authserver/models/AuthenticationForm.php +++ b/api/modules/authserver/models/AuthenticationForm.php @@ -69,8 +69,8 @@ class AuthenticationForm extends Form { protected function createMinecraftAccessToken(Account $account) : MinecraftAccessKey { /** @var MinecraftAccessKey|null $accessTokenModel */ $accessTokenModel = MinecraftAccessKey::findOne([ - 'client_token' => $this->clientToken, 'account_id' => $account->id, + 'client_token' => $this->clientToken, ]); if ($accessTokenModel === null) { diff --git a/console/migrations/m161024_234121_remove_client_token_index.php b/console/migrations/m161024_234121_remove_client_token_index.php new file mode 100644 index 0000000..5561067 --- /dev/null +++ b/console/migrations/m161024_234121_remove_client_token_index.php @@ -0,0 +1,15 @@ +dropIndex('client_token', '{{%minecraft_access_keys}}'); + } + + public function safeDown() { + $this->createIndex('client_token', '{{%minecraft_access_keys}}', 'client_token', true); + } + +}