Remove reactions when messages are removed, fixes #5164
parent
c8dfa199a8
commit
ae9e183afe
@ -0,0 +1,9 @@ |
||||
RocketChat.Migrations.add({ |
||||
version: 71, |
||||
up: function() { |
||||
//Removes the reactions on messages which are the system type "rm" ;)
|
||||
RocketChat.models.Messages.find({ 't': 'rm', 'reactions': { $exists: true, $not: {$size: 0} } }, { t: 1 }).forEach(function(message) { |
||||
RocketChat.models.Messages.update({ _id: message._id }, { $set: { reactions: [] }}); |
||||
}); |
||||
} |
||||
}); |
Loading…
Reference in new issue