Fixed indexes in the categories table.
This commit is contained in:
parent
031675e3b0
commit
8663419790
1 changed files with 26 additions and 0 deletions
26
database/2019_04_10_093908_fix_forum_indices.php
Normal file
26
database/2019_04_10_093908_fix_forum_indices.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
namespace Misuzu\DatabaseMigrations\FixForumIndices;
|
||||
|
||||
use PDO;
|
||||
|
||||
function migrate_up(PDO $conn): void
|
||||
{
|
||||
$conn->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`);
|
||||
");
|
||||
}
|
Loading…
Reference in a new issue