Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require_once QA_INCLUDE_DIR.'qa-db-selects.php';
require_once QA_INCLUDE_DIR.'qa-db-admin.php';
$query = "SHOW INDEX FROM ^messages WHERE key_name = 'tohidden'";
$result = qa_db_read_one_value(qa_db_query_sub($query), true);
$shouldRun = !isset($result);
if ($shouldRun) {
echo "Running the update...<br>";
qa_db_query_sub('DROP INDEX fromhidden on ^messages');
qa_db_query_sub('ALTER TABLE qa_messages ADD KEY fromhidden (fromhidden), ADD KEY tohidden (tohidden)');
echo "Update done!!<br>";
} else {
echo "You should not run the update<br>";
}
// Get relevant list of categories
$editcategoryid=qa_post_text('edit');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment