diff --git a/server/startup/migrations/v132.js b/server/startup/migrations/v132.js new file mode 100644 index 0000000000000..22c51d9d5ec54 --- /dev/null +++ b/server/startup/migrations/v132.js @@ -0,0 +1,17 @@ +RocketChat.Migrations.add({ + version: 132, + up() { + RocketChat.models.Rooms.find({ t: 'l', label: { $exists: true }, fname: { $exists: false } }).forEach(function(room) { + RocketChat.models.Rooms.update({ _id: room._id }, { + $set: { + fname: room.label, + }, + }); + RocketChat.models.Subscriptions.update({ rid: room._id }, { + $set: { + fname: room.label, + }, + }, { multi: true }); + }); + }, +});