Prevent delete-extraneous-posts command from removing locally-linked posts

This commit is contained in:
silverpill 2023-02-23 21:30:44 +00:00
parent 59a5f7b4fc
commit bacb8c8380
2 changed files with 6 additions and 2 deletions

View file

@ -16,6 +16,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Deprecated `proxy_url` configuration paramter (replaced by `federation.proxy_url`). - Deprecated `proxy_url` configuration paramter (replaced by `federation.proxy_url`).
### Fixed
- Prevent `delete-extraneous-posts` command from removing locally-linked posts.
## [1.14.0] - 2023-02-22 ## [1.14.0] - 2023-02-22
### Added ### Added

View file

@ -1177,10 +1177,10 @@ pub async fn find_extraneous_posts(
AND NOT EXISTS ( AND NOT EXISTS (
SELECT 1 SELECT 1
FROM post_link FROM post_link
JOIN post ON post_link.target_id = post.id JOIN post ON post_link.source_id = post.id
JOIN actor_profile ON post.author_id = actor_profile.id JOIN actor_profile ON post.author_id = actor_profile.id
WHERE WHERE
post_link.source_id = ANY(context.posts) post_link.target_id = ANY(context.posts)
AND actor_profile.actor_json IS NULL AND actor_profile.actor_json IS NULL
) )
", ",