misuzu/database/2020_05_27_134934_add_missing_indexes.php

36 lines
1 KiB
PHP
Raw Normal View History

2022-09-13 13:14:49 +00:00
<?php
namespace Misuzu\DatabaseMigrations\AddMissingIndexes;
use PDO;
function migrate_up(PDO $conn): void {
$conn->exec("
ALTER TABLE `msz_forum_categories`
ADD INDEX `forum_link_clicks_index` (`forum_link_clicks`),
ADD INDEX `forum_hidden_index` (`forum_hidden`);
");
$conn->exec("
ALTER TABLE `msz_login_attempts`
ADD INDEX `login_attempts_success_index` (`attempt_success`),
ADD INDEX `login_attempts_ip_index` (`attempt_ip`);
");
$conn->exec("
ALTER TABLE `msz_news_categories`
ADD INDEX `news_categories_is_hidden_index` (`category_is_hidden`);
");
$conn->exec("
ALTER TABLE `msz_roles`
ADD INDEX `roles_hierarchy_index` (`role_hierarchy`),
ADD INDEX `roles_hidden_index` (`role_hidden`);
");
$conn->exec("
ALTER TABLE `msz_user_relations`
ADD INDEX `user_relations_type_index` (`relation_type`),
ADD INDEX `user_relations_created_index` (`relation_created`);
");
}