Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Fix edge case in migration helpers that caused crash because of Postg…
Browse files Browse the repository at this point in the history
…reSQL quirks (mastodon#17398)
  • Loading branch information
ClearlyClaire authored Jan 30, 2022
1 parent ac583fc commit a99adea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mastodon/migration_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def update_column_in_batches(table_name, column, value)
table = Arel::Table.new(table_name)

total = estimate_rows_in_table(table_name).to_i
if total == 0
if total < 1
count_arel = table.project(Arel.star.count.as('count'))
count_arel = yield table, count_arel if block_given?

Expand Down

0 comments on commit a99adea

Please sign in to comment.