summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-08-04 13:12:23 -0500
committerMark Felder <feld@FreeBSD.org>2020-08-04 14:58:42 -0500
commit079e410d6efcb39e72a238c13e52bd1898b442a2 (patch)
treed7a91f46f5142a45b0772334fb63d7a91ed8dbe1 /priv
parent917aa090f05a6419c55b8ab57f5c9d6b4590078c (diff)
Add a migration to clean up activity_expirations table
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs19
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