diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-01-30 22:34:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-30 22:34:54 +0100 |
commit | a99adeaad332d43daa1dd8aa651c57ed82acc384 (patch) | |
tree | 11a636b618a9d491ba3f31c1ada57e87f0a893b2 /lib | |
parent | ac583fce215ff5951b06d3a3da6df397c300df40 (diff) |
Fix edge case in migration helpers that caused crash because of PostgreSQL quirks (#17398)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mastodon/migration_helpers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mastodon/migration_helpers.rb b/lib/mastodon/migration_helpers.rb index 39a6e0680..5bc903349 100644 --- a/lib/mastodon/migration_helpers.rb +++ b/lib/mastodon/migration_helpers.rb @@ -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? |