]> cat aescling's git repositories - mastodon.git/commitdiff
Fix edge case in migration helpers that caused crash because of PostgreSQL quirks...
authorClaire <claire.github-309c@sitedethib.com>
Sun, 30 Jan 2022 21:34:54 +0000 (22:34 +0100)
committerGitHub <noreply@github.com>
Sun, 30 Jan 2022 21:34:54 +0000 (22:34 +0100)
lib/mastodon/migration_helpers.rb

index 39a6e0680800ba46f64e173cd9b6f525c076e83f..5bc903349af10461e2992554b02b28bcd9b0e039 100644 (file)
@@ -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?