diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-01-28 04:18:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-28 04:18:35 +0100 |
commit | 5d312ef9c7340a091a3d42975eae5d82acd60bf5 (patch) | |
tree | 14350fe0d3051d5e1fd1b467f5513dd6107be847 /db/migrate | |
parent | d4300c3b980db259f003114e5910509eca7bbfde (diff) |
Fix slow fallback of CopyAccountStats migration setting stats to 0 (#9930)
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20181116173541_copy_account_stats.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/20181116173541_copy_account_stats.rb b/db/migrate/20181116173541_copy_account_stats.rb index bb523fbbd..8e27eb11b 100644 --- a/db/migrate/20181116173541_copy_account_stats.rb +++ b/db/migrate/20181116173541_copy_account_stats.rb @@ -44,7 +44,7 @@ class CopyAccountStats < ActiveRecord::Migration[5.2] # uniqueness violations that we need to skip over Account.unscoped.select('id, statuses_count, following_count, followers_count, created_at, updated_at').find_each do |account| begin - params = [[nil, account.id], [nil, account.statuses_count], [nil, account.following_count], [nil, account.followers_count], [nil, account.created_at], [nil, account.updated_at]] + params = [[nil, account.id], [nil, account[:statuses_count]], [nil, account[:following_count]], [nil, account[:followers_count]], [nil, account.created_at], [nil, account.updated_at]] exec_insert('INSERT INTO account_stats (account_id, statuses_count, following_count, followers_count, created_at, updated_at) VALUES ($1, $2, $3, $4, $5, $6)', nil, params) rescue ActiveRecord::RecordNotUnique next |