diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2019-08-02 18:16:04 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2019-08-02 18:16:04 +0300 |
commit | 9d4f34fbcb1a8e2eca424b3a3374c9f9af972574 (patch) | |
tree | c5943eb5d2652e08cc12d0b58a992376c425e66d /lib/mix/tasks | |
parent | d2da3d30f3349946500423bab53e0c1221ab7b9b (diff) | |
parent | 5ff8f07ca906d77a6ec1d5ba912a787f855364f9 (diff) | |
download | pleroma-9d4f34fbcb1a8e2eca424b3a3374c9f9af972574.tar.gz |
Merge branch 'develop' into feature/digest-email
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r-- | lib/mix/tasks/pleroma/config.ex | 2 | ||||
-rw-r--r-- | lib/mix/tasks/pleroma/database.ex | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/mix/tasks/pleroma/config.ex b/lib/mix/tasks/pleroma/config.ex index a7d0fac5d..462940e7e 100644 --- a/lib/mix/tasks/pleroma/config.ex +++ b/lib/mix/tasks/pleroma/config.ex @@ -15,7 +15,7 @@ defmodule Mix.Tasks.Pleroma.Config do mix pleroma.config migrate_to_db - ## Transfers config from DB to file. + ## Transfers config from DB to file `config/env.exported_from_db.secret.exs` mix pleroma.config migrate_from_db ENV """ 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()) |