Prechádzať zdrojové kódy

Add editor_id_idx index for ::posts table

Visman 1 rok pred
rodič
commit
a828436496

+ 3 - 2
app/Models/Pages/Admin/Install.php

@@ -931,8 +931,9 @@ class Install extends Admin
             ],
             ],
             'PRIMARY KEY' => ['id'],
             'PRIMARY KEY' => ['id'],
             'INDEXES' => [
             '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,
             'ENGINE' => $this->DBEngine,
         ];
         ];

+ 3 - 1
app/Models/Pages/Admin/Update.php

@@ -25,7 +25,7 @@ class Update extends Admin
 {
 {
     const PHP_MIN                    = '8.0.0';
     const PHP_MIN                    = '8.0.0';
     const REV_MIN_FOR_UPDATE         = 53;
     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_NAME                  = 'lock_update';
     const LOCK_TTL                   = 1800;
     const LOCK_TTL                   = 1800;
     const CONFIG_FILE                = 'main.php';
     const CONFIG_FILE                = 'main.php';
@@ -884,6 +884,8 @@ class Update extends Admin
 
 
         $config->save();
         $config->save();
 
 
+        $this->c->DB->addIndex('::posts', 'editor_id_idx', ['editor_id']);
+
         return null;
         return null;
     }
     }
 }
 }