Add activity expirations table

Add a table to store activity expirations. An activity can have zero or
one expirations. The expiration has a scheduled_at field which stores
the time at which the activity should expire and be deleted.
This commit is contained in:
Mike Verdone 2019-07-22 14:16:20 +02:00
commit 666514194a
6 changed files with 92 additions and 1 deletions

View file

@ -164,4 +164,13 @@ defmodule Pleroma.ActivityTest do
Pleroma.Config.put([:instance, :limit_to_local_content], :unauthenticated)
end
end
test "add an activity with an expiration" do
activity = insert(:note_activity)
insert(:expiration_in_the_future, %{activity_id: activity.id})
Pleroma.ActivityExpiration
|> where([a], a.activity_id == ^activity.id)
|> Repo.one!()
end
end