mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix edge case in migration helpers that caused crash because of PostgreSQL quirks (#17398)
This commit is contained in:
parent
b782f86b51
commit
0dc103ea11
@ -295,7 +295,7 @@ module Mastodon
|
||||
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?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user