Skip to content

Instantly share code, notes, and snippets.

@jackpoz
Last active August 10, 2019 08:33
Show Gist options
  • Save jackpoz/539889d2fd1101e607218370e1ea647f to your computer and use it in GitHub Desktop.
Save jackpoz/539889d2fd1101e607218370e1ea647f to your computer and use it in GitHub Desktop.
clean bots
DELETE FROM auth.account WHERE username LIKE 'bot%' AND username != 'botfarm';
DELETE t FROM auth.realmcharacters AS t LEFT JOIN auth.account AS a ON t.acctid = a.id WHERE a.id IS NULL;
DELETE c FROM characters.characters AS c LEFT JOIN auth.account AS a ON c.account = a.id WHERE a.id IS NULL;
DELETE t FROM characters.character_skills AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_reputation AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_inventory AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_homebind AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_glyphs AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_battleground_data AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_aura AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_action AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_achievement_progress AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_achievement AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.character_account_data AS t LEFT JOIN characters.characters AS c ON t.guid = c.guid WHERE c.guid IS NULL;
DELETE t FROM characters.item_instance AS t LEFT JOIN characters.characters AS c ON t.owner_guid = c.guid WHERE c.guid IS NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment