-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backfill data page - question on "next_page = results |> Enum.reverse() |> List.first()" #13
Comments
That's a good catch! I suspect adding an order during update could make it deterministic, otherwise sorting application-side is fine too. |
Ah thanks for confirming! Would it be possible to edit the example in the article? The migration series of articles is imho a very important document that I refer to time and time again at work. Really appreciate the work put into the article!! |
Will do! |
I haven't forgotten about this. FWIW, I think adding a CTE to ensure order is the right solution (or sorting Elixir-side), just need to write the example and test it. |
@dbernheisel no worries thank you! |
Hi, in https://fly.io/phoenix-files/backfilling-data/#batching-deterministic-data - The code in getting the
next_page
id, this seems to imply thatRepo.update_all
would return the results in an ordered list, and in reversed order.Would that be true? I wonder if you'd need to do some sorting on the
result
to get the tail of the result?The text was updated successfully, but these errors were encountered: