-
-
Save bhubbard/a7483548b2d186bfe085a3f7e17b28ac to your computer and use it in GitHub Desktop.
Queries to delete InfiniteWP site history and stats of deleted sites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM iwp_history WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites ); | |
DELETE FROM iwp_history_additional_data WHERE historyID NOT IN ( SELECT historyID FROM iwp_history ); | |
DELETE FROM iwp_history_raw_details WHERE historyID NOT IN ( SELECT historyID FROM iwp_history ); | |
DELETE FROM iwp_site_stats WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites ); | |
DELETE FROM iwp_user_access WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites ); | |
DELETE FROM iwp_groups_sites WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites ); | |
UPDATE iwp_sites SET adminUsername = 'todo' WHERE adminUsername = 'pronamic'; | |
SELECT | |
s.siteID, | |
s.URL, | |
s.name, | |
s.adminUsername | |
FROM | |
iwp_sites AS s | |
LEFT JOIN | |
iwp_groups_sites AS gs | |
ON gs.siteID = s.siteID | |
WHERE | |
gs.groupID = 3 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment