From 86634197900c7d101051cd003eb6dbcc47c401eb Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 10 Apr 2019 15:57:24 +0200 Subject: [PATCH] Fixed indexes in the categories table. --- .../2019_04_10_093908_fix_forum_indices.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 database/2019_04_10_093908_fix_forum_indices.php diff --git a/database/2019_04_10_093908_fix_forum_indices.php b/database/2019_04_10_093908_fix_forum_indices.php new file mode 100644 index 00000000..f05aa12e --- /dev/null +++ b/database/2019_04_10_093908_fix_forum_indices.php @@ -0,0 +1,26 @@ +exec(" + ALTER TABLE `msz_forum_categories` + DROP INDEX `forums_indices`, + ADD INDEX `forum_order_index` (`forum_order`), + ADD INDEX `forum_parent_index` (`forum_parent`), + ADD INDEX `forum_type_index` (`forum_type`); + "); +} + +function migrate_down(PDO $conn): void +{ + $conn->exec(" + ALTER TABLE `msz_forum_categories` + DROP INDEX `forum_order_index`, + DROP INDEX `forum_parent_index`, + DROP INDEX `forum_type_index`, + ADD INDEX `forums_indices` (`forum_order`, `forum_parent`, `forum_type`); + "); +}