### Fixed
- Don't crash so hard when email settings are invalid.
- Checking activated Upload Filters for required commands.
+- Mix task `pleroma.database prune_objects`
### Removed
- **Breaking**: Remove deprecated `/api/qvitter/statuses/notifications/read` (replaced by `/api/v1/pleroma/notifications/read`)
)
|> 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
--- /dev/null
+defmodule Pleroma.Repo.Migrations.DeleteHashtagsObjectsCascade do
+ use Ecto.Migration
+
+ def up do
+ execute("ALTER TABLE hashtags_objects DROP CONSTRAINT hashtags_objects_object_id_fkey")
+
+ alter table(:hashtags_objects) do
+ modify(:object_id, references(:objects, on_delete: :delete_all))
+ end
+ end
+
+ def down do
+ execute("ALTER TABLE hashtags_objects DROP CONSTRAINT hashtags_objects_object_id_fkey")
+
+ alter table(:hashtags_objects) do
+ modify(:object_id, references(:objects, on_delete: :nothing))
+ end
+ end
+end