diff --git a/db/migrate/20200403100259_add_key_hash_to_user_api_key.rb b/db/migrate/20200403100259_add_key_hash_to_user_api_key.rb index 2e998fc2558..138cf28b553 100644 --- a/db/migrate/20200403100259_add_key_hash_to_user_api_key.rb +++ b/db/migrate/20200403100259_add_key_hash_to_user_api_key.rb @@ -8,7 +8,7 @@ class AddKeyHashToUserApiKey < ActiveRecord::Migration[6.0] loop do rows = DB .query("SELECT id, key FROM user_api_keys WHERE key_hash IS NULL LIMIT #{batch_size}") - .map { |row| { id: row.id, key_hash: Digest::SHA256.hexdigest(key) } } + .map { |row| { id: row.id, key_hash: Digest::SHA256.hexdigest(row.key) } } break if rows.size == 0