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/v091.js

23 lines
462 B

RocketChat.Migrations.add({
version: 91,
up() {
const query = {
'services.linkedin': {
$exists: 1
},
$or: [{
name: {
$exists: 0
}
}, {
name: null
}]
};
RocketChat.models.Users.find(query, {'services.linkedin.firstName': 1, username: 1}).forEach((user) => {
const name = `${ user.services.linkedin.firstName } ${ user.services.linkedin.lastName }`;
RocketChat.models.Users.setName(user._id, name);
});
}
});