projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/update-description-for-frontends-setting' into 'develop'
[akkoma]
/
priv
/
repo
/
migrations
/
20200808173046_only_expire_creates.exs
diff --git
a/priv/repo/migrations/20200808173046_only_expire_creates.exs
b/priv/repo/migrations/20200808173046_only_expire_creates.exs
index 42fb7337539665944123317defb29b8fd39a00f2..9df52956f044ab9ec3654e78571882f95d5f2cf5 100644
(file)
--- 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
def up do
statement = """
DELETE FROM
- activity_expirations
A USING activities B
+ activity_expirations
a_exp USING activities a, objects o
WHERE
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)
"""
execute(statement)