diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-08-12 12:41:47 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-08-12 12:41:47 +0300 |
commit | 57b455de5a378d661eb794c2c9d75a2684d74ef3 (patch) | |
tree | 792155132ca31ac9cd95141cb7e34e003d6ceb07 /priv/repo/migrations/20200808173046_only_expire_creates.exs | |
parent | 724ed354f25fb83f65dff2fbadd4b5a121fb77d0 (diff) | |
download | pleroma-57b455de5a378d661eb794c2c9d75a2684d74ef3.tar.gz pleroma-57b455de5a378d661eb794c2c9d75a2684d74ef3.zip |
leave expirations with Create and Note types
Diffstat (limited to 'priv/repo/migrations/20200808173046_only_expire_creates.exs')
-rw-r--r-- | priv/repo/migrations/20200808173046_only_expire_creates.exs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/priv/repo/migrations/20200808173046_only_expire_creates.exs b/priv/repo/migrations/20200808173046_only_expire_creates.exs index 42fb73375..9df52956f 100644 --- a/priv/repo/migrations/20200808173046_only_expire_creates.exs +++ b/priv/repo/migrations/20200808173046_only_expire_creates.exs @@ -4,10 +4,10 @@ defmodule Pleroma.Repo.Migrations.OnlyExpireCreates do def up do statement = """ DELETE FROM - activity_expirations A USING activities B + activity_expirations a_exp USING activities a, objects o WHERE - A.activity_id = B.id - AND B.data->>'type' != 'Create'; + a_exp.activity_id = a.id AND (o.data->>'id') = COALESCE(a.data->'object'->>'id', a.data->>'object') + AND (a.data->>'type' != 'Create' OR o.data->>'type' != 'Note'); """ execute(statement) |