Skip to content
Snippets Groups Projects
Commit dad206f1 authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #5792 from RocketChat/fix-internalhubot-username

Migration for internal hubot username
parents 63f076bd 0821885d
No related branches found
No related tags found
No related merge requests found
RocketChat.Migrations.add({
version: 83,
up: function() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings && RocketChat.models.Users) {
var setting = RocketChat.models.Settings.findOne({ _id: 'InternalHubot_Username' });
if (setting && setting.value) {
var username = setting.value;
var user = RocketChat.models.Users.findOne({ username: username });
if (!user && setting.value === 'Rocket.Cat') {
RocketChat.models.Settings.update({ _id: 'InternalHubot_Username' }, { $set: { value: 'rocket.cat', packageValue: 'rocket.cat' } });
}
}
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment