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

20 lines
489 B

RocketChat.Migrations.add({
version: 85,
up() {
const query = {
t: 'p',
usernames: {$size: 2},
u: {$exists: false},
name: {$exists: false}
};
const rooms = RocketChat.models.Rooms.find(query).fetch();
if (rooms.length > 0) {
const rids = rooms.map(room => room._id);
RocketChat.models.Rooms.update({_id: {$in: rids}}, {$set: {t: 'd'}}, {multi: true});
RocketChat.models.Subscriptions.update({rid: {$in: rids}}, {$set: {t: 'd'}}, {multi: true});
}
}
});