mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2025-01-10 09:30:45 +00:00
Merge pull request 'Update hashtag prune to account for followed hashtags' (#844) from norm/akkoma:hashtag-prune into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/844
This commit is contained in:
commit
3ba743d635
|
@ -343,10 +343,16 @@ defmodule Mix.Tasks.Pleroma.Database do
|
||||||
|
|
||||||
%{:num_rows => del_hashtags} =
|
%{:num_rows => del_hashtags} =
|
||||||
"""
|
"""
|
||||||
DELETE FROM hashtags AS ht
|
DELETE FROM hashtags
|
||||||
WHERE NOT EXISTS (
|
USING hashtags AS ht
|
||||||
SELECT 1 FROM hashtags_objects hto
|
LEFT JOIN hashtags_objects hto
|
||||||
WHERE ht.id = hto.hashtag_id)
|
ON ht.id = hto.hashtag_id
|
||||||
|
LEFT JOIN user_follows_hashtag ufht
|
||||||
|
ON ht.id = ufht.hashtag_id
|
||||||
|
WHERE
|
||||||
|
hashtags.id = ht.id
|
||||||
|
AND hto.hashtag_id is NULL
|
||||||
|
AND ufht.hashtag_id is NULL
|
||||||
"""
|
"""
|
||||||
|> Repo.query!()
|
|> Repo.query!()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue