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

14 lines
476 B

import { Migrations } from '../../../app/migrations';
import { Rooms, Messages } from '../../../app/models';
import s from 'underscore.string';
Migrations.add({
version: 55,
up() {
Rooms.find({ topic: { $exists: 1, $ne: '' } }, { topic: 1 }).forEach(function(room) {
const topic = s.escapeHTML(room.topic);
Rooms.update({ _id: room._id }, { $set: { topic } });
Messages.update({ t: 'room_changed_topic', rid: room._id }, { $set: { msg: topic } });
});
},
});