1 defmodule Pleroma.Repo.Migrations.FillActorField do
4 alias Pleroma.{Repo, Activity}
7 max = Repo.aggregate(Activity, :max, :id)
8 IO.puts("#{max} activities")
9 chunks = 0..(round(max / 10_000))
11 Enum.each(chunks, fn (i) ->
14 IO.puts("Updating #{min}")
16 update activities set actor = data->>'actor' where id > #{min} and id <= #{max};