The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/startup/migrations/v1.coffee

10 lines
392 B

Meteor.startup ->
Migrations.add
version: 1
up: ->
Meteor.users.find({username: {$exists: false}, lastLogin: {$exists: true}}).forEach (user) ->
username = generateSuggestion(user)
if username? and username.trim() isnt ''
Meteor.users.update({_id: user._id}, {$set: {username: username}})
else
console.log "User without username", JSON.stringify(user, null, ' ')