2018-03-26 11:23:55 +00:00
|
|
|
const { default: User } = require('../../built/api/models/user');
|
|
|
|
const { generate } = require('../../built/crypto_key');
|
|
|
|
|
|
|
|
const updates = [];
|
|
|
|
|
|
|
|
User.find({}).each(function(user) {
|
|
|
|
updates.push(User.update({ _id: user._id }, {
|
|
|
|
$set: {
|
2018-03-27 03:18:22 +00:00
|
|
|
'account.keypair': generate(),
|
2018-03-26 11:23:55 +00:00
|
|
|
}
|
|
|
|
}));
|
|
|
|
}).then(function () {
|
|
|
|
Promise.all(updates)
|
|
|
|
}).then(process.exit);
|