akkoma/priv/repo/migrations/20220831170605_remove_local_cancelled_follows.exs

23 lines
347 B
Elixir
Raw Normal View History

defmodule Pleroma.Repo.Migrations.RemoveLocalCancelledFollows do
use Ecto.Migration
def up do
statement = """
DELETE FROM
activities
WHERE
(data->>'type') = 'Follow'
AND
(data->>'state') = 'cancelled'
AND
local = true;
"""
execute(statement)
end
def down do
:ok
end
end