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

18 lines
559 B

import { Migrations } from '../../../app/migrations';
import { Settings, Users } from '../../../app/models';
Migrations.add({
version: 83,
up() {
if (Settings && Users) {
const setting = Settings.findOne({ _id: 'InternalHubot_Username' });
if (setting && setting.value) {
const username = setting.value;
const user = Users.findOne({ username });
if (!user && setting.value === 'Rocket.Cat') {
Settings.update({ _id: 'InternalHubot_Username' }, { $set: { value: 'rocket.cat', packageValue: 'rocket.cat' } });
}
}
}
},
});