aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2019-07-29 02:43:19 +0000
committerAriadne Conill <ariadne@dereferenced.org>2019-07-29 02:43:19 +0000
commitb93498eb5289dc92587b77c316ed9f697bb9e5c8 (patch)
tree111e1e9af9aa8c2ea40989e1897320b34c796ace /lib/mix/tasks
parent9d78b3b281ff7f758d4e0dce19fd74d938e47ccc (diff)
downloadpleroma-b93498eb5289dc92587b77c316ed9f697bb9e5c8.tar.gz
constants: add as_public constant and use it everywhere
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r--lib/mix/tasks/pleroma/database.ex12
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())