Merge branch 'develop' into fix/activity-expirations-again
[akkoma] / priv / repo / migrations / 20200808173046_only_expire_creates.exs
1 defmodule Pleroma.Repo.Migrations.OnlyExpireCreates do
2 use Ecto.Migration
3
4 def up do
5 statement = """
6 DELETE FROM
7 activity_expirations A USING activities B
8 WHERE
9 A.activity_id = B.id
10 AND B.data->>'type' != 'Create';
11 """
12
13 execute(statement)
14 end
15
16 def down do
17 :ok
18 end
19 end