From: Mark Felder Date: Sat, 8 Aug 2020 17:33:37 +0000 (-0500) Subject: Add migration to remove invalid activity expirations X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2e7c5fe2ded095c95f8596970d8fc3aaf0128f1b;p=akkoma Add migration to remove invalid activity expirations --- diff --git a/priv/repo/migrations/20200808173046_only_expire_creates.exs b/priv/repo/migrations/20200808173046_only_expire_creates.exs new file mode 100644 index 000000000..5a34dc7c1 --- /dev/null +++ b/priv/repo/migrations/20200808173046_only_expire_creates.exs @@ -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