diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-09-26 23:10:32 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-09-26 23:10:32 +0200 |
commit | f6a0754fdacf9b890292f1efc62a9035bceb454a (patch) | |
tree | 236e80a5026d78930978a211f5d6939529945805 /server/initializers/migrations | |
parent | da4971c11f16b541804b5071d543166cd3954a98 (diff) | |
download | PeerTube-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.js | 9 |
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 | ||
5 | const eachSeries = require('async/eachSeries') | ||
5 | const mongoose = require('mongoose') | 6 | const mongoose = require('mongoose') |
6 | 7 | ||
7 | const User = mongoose.model('User') | 8 | const 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 | ||