First
[anni] / priv / repo / migrations / 20200804180322_remove_nonlocal_expirations.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Repo.Migrations.RemoveNonlocalExpirations do
6   use Ecto.Migration
7
8   def up do
9     statement = """
10     DELETE FROM
11       activity_expirations A USING activities B
12     WHERE
13       A.activity_id = B.id
14       AND B.local = false;
15     """
16
17     execute(statement)
18   end
19
20   def down do
21     :ok
22   end
23 end