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