From cf4c97242be588e55dfccb37ab2c3d6dcac3cb0f Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sat, 8 Aug 2020 12:40:52 -0500 Subject: [PATCH] Ensure we only expire Create activities with the Mix task --- lib/mix/tasks/pleroma/database.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/mix/tasks/pleroma/database.ex b/lib/mix/tasks/pleroma/database.ex index d57e59b11..b2dc3d0f3 100644 --- a/lib/mix/tasks/pleroma/database.ex +++ b/lib/mix/tasks/pleroma/database.ex @@ -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 -> -- 2.45.2