mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 04:49:23 +00:00
0ec3a11895
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/149
36 lines
571 B
Elixir
36 lines
571 B
Elixir
defmodule Pleroma.Repo.Migrations.RemoveRemoteCancelledFollowRequests do
|
|
use Ecto.Migration
|
|
|
|
def up do
|
|
statement = """
|
|
DELETE FROM
|
|
activities
|
|
WHERE
|
|
(data->>'type') = 'Follow'
|
|
AND
|
|
(data->>'state') = 'cancelled'
|
|
AND
|
|
local = false;
|
|
"""
|
|
|
|
execute(statement)
|
|
|
|
statement = """
|
|
DELETE FROM
|
|
activities
|
|
WHERE
|
|
(data->>'type') = 'Undo'
|
|
AND
|
|
(data->'object'->>'type') = 'Follow'
|
|
AND
|
|
local = false;
|
|
"""
|
|
|
|
execute(statement)
|
|
end
|
|
|
|
def down do
|
|
:ok
|
|
end
|
|
end
|