Ver Fonte

Add migration to fix circular references

Andrés Manelli há 6 anos atrás
pai
commit
a338e937e5
1 ficheiros alterados com 8 adições e 0 exclusões
  1. 8 0
      server/migrations.js

+ 8 - 0
server/migrations.js

@@ -517,3 +517,11 @@ Migrations.add('add-templates', () => {
     });
   });
 });
+
+Migrations.add('fix-circular-reference', () => {
+  Cards.find().forEach((card) => {
+    if (card.parentId === card._id) {
+      Cards.update(card._id, {$set: {parentId: ''}}, noValidateMulti);
+    }
+  });
+});