summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2019-03-07 00:13:21 +0100
committerAndrés Manelli <andresmanelli@gmail.com>2019-03-07 00:13:21 +0100
commita338e937e508568d1f6a15c5464126d30ef69a7d (patch)
treeca2e2a9748186d48c4250926eab97892587ac447 /server
parent745f39ed20169f56b99c0339f2043f8c4ed43873 (diff)
downloadwekan-a338e937e508568d1f6a15c5464126d30ef69a7d.tar.gz
wekan-a338e937e508568d1f6a15c5464126d30ef69a7d.tar.bz2
wekan-a338e937e508568d1f6a15c5464126d30ef69a7d.zip
Add migration to fix circular references
Diffstat (limited to 'server')
-rw-r--r--server/migrations.js8
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);
+ }
+ });
+});