Add migration to remove invalid activity expirations

This commit is contained in:
Mark Felder 2020-08-08 12:33:37 -05:00
parent ad29a4f2cf
commit 2e7c5fe2de

View file

@ -0,0 +1,20 @@
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.local = false
AND B.data->>'type' != 'Create';
"""
execute(statement)
end
def down do
:ok
end
end