Add keypair to local account
This commit is contained in:
parent
7b0f93464a
commit
001d5faac9
10 changed files with 146 additions and 0 deletions
16
tools/migration/node.1522066477.user-account-keypair.js
Normal file
16
tools/migration/node.1522066477.user-account-keypair.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
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: {
|
||||
account: {
|
||||
keypair: generate(),
|
||||
}
|
||||
}
|
||||
}));
|
||||
}).then(function () {
|
||||
Promise.all(updates)
|
||||
}).then(process.exit);
|
Loading…
Add table
Add a link
Reference in a new issue