Migration_34.php
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Migrations; |
| 4 | |
| 5 | use IAWP\Query; |
| 6 | /** @internal */ |
| 7 | class Migration_34 extends \IAWP\Migrations\Step_Migration |
| 8 | { |
| 9 | /** |
| 10 | * @return int |
| 11 | */ |
| 12 | protected function database_version() : int |
| 13 | { |
| 14 | return 34; |
| 15 | } |
| 16 | /** |
| 17 | * @return array |
| 18 | */ |
| 19 | protected function queries() : array |
| 20 | { |
| 21 | return [$this->add_index_for_cached_author_id()]; |
| 22 | } |
| 23 | private function add_index_for_cached_author_id() : string |
| 24 | { |
| 25 | $resources_table = Query::get_table_name(Query::RESOURCES); |
| 26 | return "\n ALTER TABLE {$resources_table}\n ADD INDEX(cached_author_id);\n "; |
| 27 | } |
| 28 | } |
| 29 |