2016-09-26 22:36:36 +02:00
|
|
|
/*
|
|
|
|
Convert plain user password to encrypted user password.
|
|
|
|
*/
|
|
|
|
|
2016-09-26 23:10:32 +02:00
|
|
|
const eachSeries = require('async/eachSeries')
|
2016-09-26 22:36:36 +02:00
|
|
|
const mongoose = require('mongoose')
|
|
|
|
|
|
|
|
const User = mongoose.model('User')
|
|
|
|
|
|
|
|
exports.up = function (callback) {
|
|
|
|
User.list(function (err, users) {
|
|
|
|
if (err) return callback(err)
|
|
|
|
|
2016-09-26 23:10:32 +02:00
|
|
|
eachSeries(users, function (user, callbackEach) {
|
|
|
|
user.save(callbackEach)
|
|
|
|
}, callback)
|
2016-09-26 22:36:36 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.down = function (callback) {
|
|
|
|
throw new Error('Not implemented.')
|
|
|
|
}
|