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

21 lines
540 B

RocketChat.Migrations.add({
version: 49,
up() {
let count = 1;
RocketChat.models.Rooms.find({ t: 'l' }, { sort: { ts: 1 }, fields: { _id: 1 } }).forEach(function(room) {
RocketChat.models.Rooms.update({ _id: room._id }, { $set: { code: count } });
RocketChat.models.Subscriptions.update({ rid: room._id }, { $set: { code: count } }, { multi: true });
count++;
});
RocketChat.models.Settings.upsert({ _id: 'Livechat_Room_Count' }, {
$set: {
value: count,
type: 'int',
group: 'Livechat'
}
});
}
});