Fix migration 86

pull/5958/head
Marcelo Schmidt 9 years ago
parent ca2d9e2813
commit 8eb9d024ca
No known key found for this signature in database
GPG Key ID: CA48C21A7B66097E
  1. 7
      server/startup/migrations/v086.js
  2. 11
      server/startup/migrations/v087.js

@ -1,11 +1,6 @@
RocketChat.Migrations.add({
version: 86,
up: function() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
RocketChat.models.Users.update({ newMessageNotification: false }, { $set: { newMessageNotification: 'none' } }, { multi: true });
RocketChat.models.Users.update({ newMessageNotification: true }, { $unset: { newMessageNotification: 1 } }, { multi: true });
RocketChat.models.Users.update({ newRoomNotification: false }, { $set: { newRoomNotification: 'none' } }, { multi: true });
RocketChat.models.Users.update({ newRoomNotification: true }, { $unset: { newRoomNotification: 1 } }, { multi: true });
}
// Disabled this migration for it was not updating any user
}
});

@ -0,0 +1,11 @@
RocketChat.Migrations.add({
version: 87,
up: function() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
RocketChat.models.Users.update({ 'settings.preferences.newMessageNotification': false }, { $set: { 'settings.preferences.newMessageNotification': 'none' } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.newMessageNotification': true }, { $unset: { 'settings.preferences.newMessageNotification': 1 } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.newRoomNotification': false }, { $set: { 'settings.preferences.newRoomNotification': 'none' } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.newRoomNotification': true }, { $unset: { 'settings.preferences.newRoomNotification': 1 } }, { multi: true });
}
}
});
Loading…
Cancel
Save