diff options
author | Andrés Manelli <andresmanelli@gmail.com> | 2019-03-07 00:13:21 +0100 |
---|---|---|
committer | Andrés Manelli <andresmanelli@gmail.com> | 2019-03-07 00:13:21 +0100 |
commit | a338e937e508568d1f6a15c5464126d30ef69a7d (patch) | |
tree | ca2e2a9748186d48c4250926eab97892587ac447 | |
parent | 745f39ed20169f56b99c0339f2043f8c4ed43873 (diff) | |
download | wekan-a338e937e508568d1f6a15c5464126d30ef69a7d.tar.gz wekan-a338e937e508568d1f6a15c5464126d30ef69a7d.tar.bz2 wekan-a338e937e508568d1f6a15c5464126d30ef69a7d.zip |
Add migration to fix circular references
-rw-r--r-- | server/migrations.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/migrations.js b/server/migrations.js index cb64b7e8..eeb2d5ea 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); + } + }); +}); |