diff options
author | Sean King <seanking2919@protonmail.com> | 2021-07-10 11:04:16 -0600 |
---|---|---|
committer | Sean King <seanking2919@protonmail.com> | 2021-07-10 11:04:16 -0600 |
commit | 5d279a22b162e7d8a871db1b9368a888e92ea167 (patch) | |
tree | 1d89f3c93ee1dc46b185f6d438828fb0b572e6be /lib/mix/tasks | |
parent | 26d2c677b78b7cc22a98dfe4648e5b3f5b4da3ea (diff) | |
parent | aa9a6c3c056fde45b4c13c9c873cef9492b279e9 (diff) | |
download | pleroma-5d279a22b162e7d8a871db1b9368a888e92ea167.tar.gz pleroma-5d279a22b162e7d8a871db1b9368a888e92ea167.zip |
Merge develop branch upstream
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r-- | lib/mix/tasks/pleroma/database.ex | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/mix/tasks/pleroma/database.ex b/lib/mix/tasks/pleroma/database.ex index e7f4b67a4..57f73d12b 100644 --- a/lib/mix/tasks/pleroma/database.ex +++ b/lib/mix/tasks/pleroma/database.ex @@ -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 |