Add migration to fix circular references

This commit is contained in:
Andrés Manelli 2019-03-07 00:13:21 +01:00
parent 745f39ed20
commit a338e937e5

View file

@ -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);
}
});
});