From a828436496fbcc06aa2bfeec4aa19606854f4c6e Mon Sep 17 00:00:00 2001 From: Visman Date: Fri, 11 Aug 2023 22:39:27 +0700 Subject: [PATCH] Add editor_id_idx index for ::posts table --- app/Models/Pages/Admin/Install.php | 5 +++-- app/Models/Pages/Admin/Update.php | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Models/Pages/Admin/Install.php b/app/Models/Pages/Admin/Install.php index 7cbc887f..33fc4b3d 100644 --- a/app/Models/Pages/Admin/Install.php +++ b/app/Models/Pages/Admin/Install.php @@ -931,8 +931,9 @@ class Install extends Admin ], 'PRIMARY KEY' => ['id'], 'INDEXES' => [ - 'topic_id_idx' => ['topic_id'], - 'multi_idx' => ['poster_id', 'topic_id', 'posted'], + 'topic_id_idx' => ['topic_id'], + 'multi_idx' => ['poster_id', 'topic_id', 'posted'], + 'editor_id_idx' => ['editor_id'], ], 'ENGINE' => $this->DBEngine, ]; diff --git a/app/Models/Pages/Admin/Update.php b/app/Models/Pages/Admin/Update.php index 62939179..b1298ffd 100644 --- a/app/Models/Pages/Admin/Update.php +++ b/app/Models/Pages/Admin/Update.php @@ -25,7 +25,7 @@ class Update extends Admin { const PHP_MIN = '8.0.0'; const REV_MIN_FOR_UPDATE = 53; - const LATEST_REV_WITH_DB_CHANGES = 67; + const LATEST_REV_WITH_DB_CHANGES = 68; const LOCK_NAME = 'lock_update'; const LOCK_TTL = 1800; const CONFIG_FILE = 'main.php'; @@ -884,6 +884,8 @@ class Update extends Admin $config->save(); + $this->c->DB->addIndex('::posts', 'editor_id_idx', ['editor_id']); + return null; } }