Skip to content

Commit

Permalink
Merge pull request #144 from doctolib/revert-batch-over-select-id
Browse files Browse the repository at this point in the history
BatchRecord: Revert selecting only PK
  • Loading branch information
CharlesDelannoy authored May 16, 2024
2 parents 2475fb4 + 5b69b55 commit fbcf746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/safe-pg-migrations/helpers/batch_over.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def each_batch
def next_batch
return if endless?

first = next_scope.select(primary_key).take
first = next_scope.take

return unless first

last = next_scope.select(primary_key).offset(@of).take
last = next_scope.offset(@of).take

first_key = first[primary_key]
last_key = last.nil? ? nil : last[primary_key]
Expand Down

0 comments on commit fbcf746

Please sign in to comment.