diff options
author | rinpatch <rinpatch@sdf.org> | 2019-07-31 14:12:29 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-07-31 14:12:29 +0300 |
commit | c88a5d32514f4ed78e4b9216198db62e8799ffe4 (patch) | |
tree | bc979f2522156be74138491114892e7acbeaafcb /lib/mix/tasks | |
parent | 41e0304757c5a0d9778f7e685c9ddf481f0e15cb (diff) | |
parent | 66575061851f13355958fd292ee545462bf191c0 (diff) | |
download | pleroma-c88a5d32514f4ed78e4b9216198db62e8799ffe4.tar.gz |
Merge branch 'develop' into feature/hide-follows-remote
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r-- | lib/mix/tasks/pleroma/database.ex | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/mix/tasks/pleroma/database.ex b/lib/mix/tasks/pleroma/database.ex index e91fb31d1..8547a329a 100644 --- a/lib/mix/tasks/pleroma/database.ex +++ b/lib/mix/tasks/pleroma/database.ex @@ -8,6 +8,7 @@ defmodule Mix.Tasks.Pleroma.Database do alias Pleroma.Repo alias Pleroma.User require Logger + require Pleroma.Constants import Mix.Pleroma use Mix.Task @@ -99,10 +100,15 @@ defmodule Mix.Tasks.Pleroma.Database do NaiveDateTime.utc_now() |> NaiveDateTime.add(-(deadline * 86_400)) - public = "https://www.w3.org/ns/activitystreams#Public" - from(o in Object, - where: fragment("?->'to' \\? ? OR ?->'cc' \\? ?", o.data, ^public, o.data, ^public), + where: + fragment( + "?->'to' \\? ? OR ?->'cc' \\? ?", + o.data, + ^Pleroma.Constants.as_public(), + o.data, + ^Pleroma.Constants.as_public() + ), where: o.inserted_at < ^time_deadline, where: fragment("split_part(?->>'actor', '/', 3) != ?", o.data, ^Pleroma.Web.Endpoint.host()) |