unoffical wafrn mirror wafrn.net
atproto social-network activitypub
at development 20 lines 1.2 kB view raw
1-- so turns out that an instance is pure shit. Or that you got yourself your instance to refer itself somehow. well fuck-- 2-- we need the id of the instance to remove and the id of the "removed user" that all post with no user go to. 3 4select * from federatedHosts where displayName like 'PROBLEMATIC_INSTANCE_HERE' 5 6-- wafrn deleted user uuid: 066f4e2d-f407-452d-9603-8dbc5fd0d52a 7 8-- we edit post 9update posts SET userId='DELETED_USER_ID' where userId in (select id from users where users.federatedHostId like'ID_OF_INSTANCE') 10-- we remove mentions 11delete from postMentionsUserRelations where userId in (select id from users where users.federatedHostId like'ID_OF_INSTANCE'); 12-- we remove likes 13delete from userLikesPostRelations where userId in (select id from users where users.federatedHostId like'ID_OF_INSTANCE'); 14-- we remove follows 15delete from follows where followedId in (select id from users where users.federatedHostId like'ID_OF_INSTANCE'); 16delete from follows where followerId in (select id from users where users.federatedHostId like'ID_OF_INSTANCE'); 17-- we remove users 18DELETE FROM users where users.federatedHostId like 'ID_OF_INSTANCE' 19-- we delete instance 20DELETE FROM federatedHosts where id like 'ID_OF_INSTANCE'