mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-22 17:27:18 +00:00
Markers migration: Fix migration for very large list of markers
This commit is contained in:
parent
768c18facb
commit
d8dd945a03
|
@ -32,9 +32,13 @@ defmodule Pleroma.Repo.Migrations.UpdateMarkers do
|
||||||
|> Map.put_new(:updated_at, now)
|
|> Map.put_new(:updated_at, now)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Repo.insert_all("markers", markers_attrs,
|
markers_attrs
|
||||||
on_conflict: {:replace, [:last_read_id]},
|
|> Enum.chunk(1000)
|
||||||
conflict_target: [:user_id, :timeline]
|
|> Enum.each(fn marker_attrs ->
|
||||||
)
|
Repo.insert_all("markers", markers_attrs,
|
||||||
|
on_conflict: {:replace, [:last_read_id]},
|
||||||
|
conflict_target: [:user_id, :timeline]
|
||||||
|
)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue