Merge branch 'fix/prune-hashtags' into 'develop'
get prune_objects to work again See merge request pleroma/pleroma!3397
This commit is contained in:
commit
b553bfd745
3 changed files with 29 additions and 0 deletions
|
|
@ -96,6 +96,15 @@ defmodule Mix.Tasks.Pleroma.Database do
|
|||
)
|
||||
|> Repo.delete_all(timeout: :infinity)
|
||||
|
||||
prune_hashtags_query = """
|
||||
DELETE FROM hashtags AS ht
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM hashtags_objects hto
|
||||
WHERE ht.id = hto.hashtag_id)
|
||||
"""
|
||||
|
||||
Repo.query(prune_hashtags_query)
|
||||
|
||||
if Keyword.get(options, :vacuum) do
|
||||
Maintenance.vacuum("full")
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue