mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
parent
0653750fbf
commit
2e8f54e9ee
@ -8,7 +8,7 @@ class AddKeyHashToUserApiKey < ActiveRecord::Migration[6.0]
|
|||||||
loop do
|
loop do
|
||||||
rows = DB
|
rows = DB
|
||||||
.query("SELECT id, key FROM user_api_keys WHERE key_hash IS NULL LIMIT #{batch_size}")
|
.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
|
break if rows.size == 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user