mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-27 19:50:56 +00:00
Fix migration - scrypt
This commit is contained in:
parent
3569f52d4a
commit
7ec70323bf
1 changed files with 1 additions and 2 deletions
|
@ -2,10 +2,9 @@
|
||||||
ENV['SCRYPT_MAX_TIME'] ||= "0.03"
|
ENV['SCRYPT_MAX_TIME'] ||= "0.03"
|
||||||
class UpdatePasswordsToScrypt < ActiveRecord::Migration[6.0]
|
class UpdatePasswordsToScrypt < ActiveRecord::Migration[6.0]
|
||||||
require 'scrypt'
|
require 'scrypt'
|
||||||
require 'user'
|
|
||||||
|
|
||||||
def up
|
def up
|
||||||
SCrypt::Engine.calibrate!(max_time: ENV['SCRYPT_MAX_TIME'])
|
SCrypt::Engine.calibrate!(max_time: ENV['SCRYPT_MAX_TIME'].to_f)
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
User.all.order(:id).each do |user|
|
User.all.order(:id).each do |user|
|
||||||
user.team = nil unless user&.team&.present?
|
user.team = nil unless user&.team&.present?
|
||||||
|
|
Loading…
Reference in a new issue