From a338e937e508568d1f6a15c5464126d30ef69a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Thu, 7 Mar 2019 00:13:21 +0100 Subject: [PATCH] Add migration to fix circular references --- server/migrations.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/migrations.js b/server/migrations.js index cb64b7e8a..eeb2d5ead 100644 --- a/server/migrations.js +++ b/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); + } + }); +});