aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0010-users-password.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations/0010-users-password.js')
-rw-r--r--server/initializers/migrations/0010-users-password.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/server/initializers/migrations/0010-users-password.js b/server/initializers/migrations/0010-users-password.js
new file mode 100644
index 000000000..a0616a269
--- /dev/null
+++ b/server/initializers/migrations/0010-users-password.js
@@ -0,0 +1,22 @@
1/*
2 Convert plain user password to encrypted user password.
3*/
4
5const eachSeries = require('async/eachSeries')
6const mongoose = require('mongoose')
7
8const User = mongoose.model('User')
9
10exports.up = function (callback) {
11 User.list(function (err, users) {
12 if (err) return callback(err)
13
14 eachSeries(users, function (user, callbackEach) {
15 user.save(callbackEach)
16 }, callback)
17 })
18}
19
20exports.down = function (callback) {
21 throw new Error('Not implemented.')
22}