Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

28 строки
536B

  1. defmodule Pleroma.Repo.Migrations.FillActorField do
  2. use Ecto.Migration
  3. alias Pleroma.{Repo, Activity}
  4. def up do
  5. max = Repo.aggregate(Activity, :max, :id)
  6. if max do
  7. IO.puts("#{max} activities")
  8. chunks = 0..round(max / 10_000)
  9. Enum.each(chunks, fn i ->
  10. min = i * 10_000
  11. max = min + 10_000
  12. execute("""
  13. update activities set actor = data->>'actor' where id > #{min} and id <= #{max};
  14. """)
  15. |> IO.inspect()
  16. end)
  17. end
  18. end
  19. def down do
  20. end
  21. end