Explorar o código

Add migration to fix circular references

Andrés Manelli %!s(int64=6) %!d(string=hai) anos
pai
achega
a338e937e5
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  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);
+    }
+  });
+});