Merge branch 'fix/activity-expirations-again' into 'develop'
Fix activity expirations again See merge request pleroma/pleroma!2866
This commit is contained in:
commit
14a06e63f6
8 changed files with 76 additions and 5 deletions
19
priv/repo/migrations/20200808173046_only_expire_creates.exs
Normal file
19
priv/repo/migrations/20200808173046_only_expire_creates.exs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
defmodule Pleroma.Repo.Migrations.OnlyExpireCreates do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
statement = """
|
||||
DELETE FROM
|
||||
activity_expirations a_exp USING activities a, objects o
|
||||
WHERE
|
||||
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)
|
||||
end
|
||||
|
||||
def down do
|
||||
:ok
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue