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