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

41 lines
843 B

RocketChat.Migrations.add({
version: 48,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
const RocketBot_Enabled = RocketChat.models.Settings.findOne({
_id: 'RocketBot_Enabled'
});
if (RocketBot_Enabled) {
RocketChat.models.Settings.remove({
_id: 'RocketBot_Enabled'
});
RocketChat.models.Settings.upsert({
_id: 'InternalHubot_Enabled'
}, {
$set: {
value: RocketBot_Enabled.value
}
});
}
const RocketBot_Name = RocketChat.models.Settings.findOne({
_id: 'RocketBot_Name'
});
if (RocketBot_Name) {
RocketChat.models.Settings.remove({
_id: 'RocketBot_Name'
});
RocketChat.models.Settings.upsert({
_id: 'InternalHubot_Username'
}, {
$set: {
value: RocketBot_Name.value
}
});
}
}
}
});