[FIX] Old Data Migrations breaking upgrades (#18185)

pull/18212/head
pierre-lehnen-rc 5 years ago committed by GitHub
parent 96dd97d823
commit a3e0e6ea42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      server/startup/migrations/v185.js
  2. 9
      server/startup/migrations/v187.js

@ -9,7 +9,7 @@ Migrations.add({
version: 185,
up() {
const setting = Settings.findOne({ _id: 'Message_SetNameToAliasEnabled' });
if (setting.value) {
if (setting && setting.value) {
Settings.update({ _id: 'UI_Use_Real_Name' }, {
$set: {
value: true,

@ -61,6 +61,13 @@ Migrations.add({
Settings.remove({ _id: 'Push_debug' });
Settings.remove({ _id: 'Notifications_Always_Notify_Mobile' });
Promise.await(migrateNotifications());
try {
Promise.await(migrateNotifications());
} catch (err) {
// Ignore if the collection does not exist
if (!err.code || err.code !== 26) {
throw err;
}
}
},
});

Loading…
Cancel
Save