Sha256: 39833f8cae799b2eba72ebe867d64f7988a3efe42438d9877bac4186d474ec0a
Contents?: true
Size: 544 Bytes
Versions: 10
Compression:
Stored size: 544 Bytes
Contents
Sequel.migration do up do scheme = Spontaneous::Crypt::Version::SHALegacy dataset = self[:spontaneous_users] dataset.each do |user| hash = scheme.create(user[:crypted_password], user[:salt]) dataset.filter(:id => user[:id]).update(:crypted_password => hash) end drop_column :spontaneous_users, :salt end down do # There's no way to recover from the conversion -- the # hashed password is lost so all we can do is re-add the salt # column add_column :spontaneous_users, :salt end end
Version data entries
10 entries across 10 versions & 1 rubygems