aboutsummaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-15 07:57:58 +0000
committerlain <lain@soykaf.club>2020-06-15 12:05:09 +0200
commit43eb4144d601442b0edb7f7e87c2f50d64276e1e (patch)
tree43c28b196fa5ba62bf303dcc512e8cd0128bc526 /priv
parent271ea5068f4e3b901cb3f682e132378246daf452 (diff)
parentb15cfc3d365dcfa5f99159fe06e29de6f8aceb4f (diff)
downloadpleroma-namespace-move-notification.tar.gz
Merge branch 'notifications-filtering' into 'develop'namespace-move-notification
Mastodon API return full result set in notifications See merge request pleroma/pleroma!2552
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20200527163635_delete_notifications_from_invisible_users.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200527163635_delete_notifications_from_invisible_users.exs b/priv/repo/migrations/20200527163635_delete_notifications_from_invisible_users.exs
new file mode 100644
index 000000000..9e95a8111
--- /dev/null
+++ b/priv/repo/migrations/20200527163635_delete_notifications_from_invisible_users.exs
@@ -0,0 +1,18 @@
+defmodule Pleroma.Repo.Migrations.DeleteNotificationsFromInvisibleUsers do
+ use Ecto.Migration
+
+ import Ecto.Query
+ alias Pleroma.Repo
+
+ def up do
+ Pleroma.Notification
+ |> join(:inner, [n], activity in assoc(n, :activity))
+ |> where(
+ [n, a],
+ fragment("? in (SELECT ap_id FROM users WHERE invisible = true)", a.actor)
+ )
+ |> Repo.delete_all()
+ end
+
+ def down, do: :ok
+end