diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-08-04 13:12:23 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-08-04 14:58:42 -0500 |
commit | 079e410d6efcb39e72a238c13e52bd1898b442a2 (patch) | |
tree | d7a91f46f5142a45b0772334fb63d7a91ed8dbe1 | |
parent | 917aa090f05a6419c55b8ab57f5c9d6b4590078c (diff) | |
download | pleroma-079e410d6efcb39e72a238c13e52bd1898b442a2.tar.gz |
Add a migration to clean up activity_expirations table
-rw-r--r-- | priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs b/priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs new file mode 100644 index 000000000..389935f0d --- /dev/null +++ b/priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs @@ -0,0 +1,19 @@ +defmodule Pleroma.Repo.Migrations.RemoveNonlocalExpirations 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; + """ + + execute(statement) + end + + def down do + :ok + end +end |