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

19 lines
426 B

import { addMigration } from '../../lib/migrations';
import { LivechatRooms, Subscriptions } from '../../../app/models/server';
addMigration({
version: 222,
async up() {
Subscriptions.find({
t: 'l',
}).forEach((subscription) => {
const { _id, rid } = subscription;
const room = LivechatRooms.findOneById(rid, { open: 1 });
if (room?.open) {
return;
}
Subscriptions.remove({ _id });
});
},
});