parent
0653750fbf
commit
2e8f54e9ee
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue