aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-09-26 23:10:32 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-09-26 23:10:32 +0200
commitf6a0754fdacf9b890292f1efc62a9035bceb454a (patch)
tree236e80a5026d78930978a211f5d6939529945805 /server/initializers/migrations
parentda4971c11f16b541804b5071d543166cd3954a98 (diff)
downloadPeerTube-f6a0754fdacf9b890292f1efc62a9035bceb454a.tar.gz
PeerTube-f6a0754fdacf9b890292f1efc62a9035bceb454a.tar.zst
PeerTube-f6a0754fdacf9b890292f1efc62a9035bceb454a.zip
Server: fix migration at installation
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r--server/initializers/migrations/0010-users-password.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/initializers/migrations/0010-users-password.js b/server/initializers/migrations/0010-users-password.js
index e031fa142..a0616a269 100644
--- a/server/initializers/migrations/0010-users-password.js
+++ b/server/initializers/migrations/0010-users-password.js
@@ -2,6 +2,7 @@
2 Convert plain user password to encrypted user password. 2 Convert plain user password to encrypted user password.
3*/ 3*/
4 4
5const eachSeries = require('async/eachSeries')
5const mongoose = require('mongoose') 6const mongoose = require('mongoose')
6 7
7const User = mongoose.model('User') 8const User = mongoose.model('User')
@@ -10,11 +11,9 @@ exports.up = function (callback) {
10 User.list(function (err, users) { 11 User.list(function (err, users) {
11 if (err) return callback(err) 12 if (err) return callback(err)
12 13
13 users.forEach(function (user) { 14 eachSeries(users, function (user, callbackEach) {
14 user.save() 15 user.save(callbackEach)
15 }) 16 }, callback)
16
17 return callback(null)
18 }) 17 })
19} 18}
20 19