Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
405B

  1. defmodule Pleroma.Repo.Migrations.DeleteNotificationsFromInvisibleUsers do
  2. use Ecto.Migration
  3. import Ecto.Query
  4. alias Pleroma.Repo
  5. def up do
  6. Pleroma.Notification
  7. |> join(:inner, [n], activity in assoc(n, :activity))
  8. |> where(
  9. [n, a],
  10. fragment("? in (SELECT ap_id FROM users WHERE invisible = true)", a.actor)
  11. )
  12. |> Repo.delete_all()
  13. end
  14. def down, do: :ok
  15. end