Ensure we only expire Create activities with the Mix task
authorMark Felder <feld@FreeBSD.org>
Sat, 8 Aug 2020 17:40:52 +0000 (12:40 -0500)
committerMark Felder <feld@FreeBSD.org>
Sat, 8 Aug 2020 17:40:52 +0000 (12:40 -0500)
lib/mix/tasks/pleroma/database.ex

index d57e59b113da8e40787e0d5088ee83b91f72a17c..b2dc3d0f3b81075bbe12ac083e0d0f65331d9a9d 100644 (file)
@@ -136,6 +136,7 @@ defmodule Mix.Tasks.Pleroma.Database do
     |> join(:left, [a], u in assoc(a, :expiration))
     |> where(local: true)
     |> where([a, u], is_nil(u))
+    |> where([a], fragment("(? ->> 'type'::text) = 'Create'", a.data))
     |> Pleroma.RepoStreamer.chunk_stream(100)
     |> Stream.each(fn activities ->
       Enum.each(activities, fn activity ->