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/v001.coffee

9 lines
376 B

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