summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs
diff options
context:
space:
mode:
Diffstat (limited to 'priv/repo/migrations/20200804180322_remove_nonlocal_expirations.exs')
-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