Will they be restored?
So the messages are still in the database, but I screwed up a query when I nuked the spam.
For reference a "huddle" is kinda like a direct message conversation.
The data structure is "huddle exists and contains comments, huddle profiles maps huddles to those who can view them and contribute further messages"... the profiles exist, the comments exist, but when I nuked the spam I figured I had left orphaned huddles so best delete them. I wrote a complex piece of SQL to "find huddles which have only deleted comments, remove the profiles and delete the huddle"... but the bit that is "have only deleted comments" was wrong, and the query went too far and has deleted the huddles for all on this site.
So... how to repair? Well... just get the valid huddles and huddle profiles bits back from a backup.
Where are my backups? Tarsnap.
I've been pulling a backup all day, but I back up the whole database and so far it's at 14GB downloaded and decrypted, and then I need to pull it somewhere and restore the two tables, find the rows to be copied back and then put them back.
And lesson learned? Don't delete spam manually even when I don't have access to test environments... ban first (safe) and delete later with a proven and tested script.