Skip to content

Commit

Permalink
tool/migrate: Remove points from users collection
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Apr 15, 2018
1 parent 40bcfc4 commit dce905c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ let migration = {
console.info('Migration points to %s', '7.3.0')
let users = await global.db.engine.find('users')
for (let user of users) {
await global.db.engine.update('users', { username: user.username }, { points: 0 })
await global.db.engine.insert('users.points', { username: user.username, points: !_.isNil(user.points) ? parseInt(user.points, 10) : 0 })
}
}
Expand Down

0 comments on commit dce905c

Please sign in to comment.