distraction.party/priv/repo/migrations/20200808173046_only_expire_creates.exs
2020-08-08 12:44:18 -05:00

19 lines
320 B
Elixir

defmodule Pleroma.Repo.Migrations.OnlyExpireCreates do
use Ecto.Migration
def up do
statement = """
DELETE FROM
activity_expirations A USING activities B
WHERE
A.activity_id = B.id
AND B.data->>'type' != 'Create';
"""
execute(statement)
end
def down do
:ok
end
end