replace the text 'eope.xyz' with a unique chunk of the server in question.

I put this together for myself because some communities had ceased to exist, but you could also use it because some lemmy communities like to defederate first and ask questions never.

delete from community_follow where community = any( select id from community where ap_id like '%eope.xyz%' );

delete from notification where reply= any( select id FROM reply

WHERE post = ANY(

SELECT id FROM post

WHERE community= any( select id from community where ap_id like '%eope.xyz%' )

));

DELETE FROM reply

WHERE post = ANY(

SELECT id FROM post

WHERE community= any( select id from community where ap_id like '%eope.xyz%' )

);

DELETE FROM notification WHERE parent_post = ANY(

SELECT id FROM post

WHERE community= any( select id from community where ap_id like '%eope.xyz%' )

);

delete from community where ap_id like '%eope.xyz%';