summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/migrations.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/migrations.js b/server/migrations.js
index f828a14c..932a3cfd 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -151,3 +151,27 @@ Migrations.add('add-sort-checklists', () => {
});
});
});
+
+Migrations.add('add-swimlanes', () => {
+ Boards.find().forEach((board) => {
+ const swimlane = Swimlanes.findOne({ boardId: board._id });
+ let swimlaneId = '';
+ if (swimlane)
+ swimlaneId = swimlane._id
+ else
+ swimlaneId = Swimlanes.direct.insert({
+ boardId: board._id,
+ title: 'Default'
+ });
+
+ Cards.find({ boardId: board._id }).forEach((card) => {
+ if (!card.hasOwnProperty('swimlaneId')) {
+ Cards.direct.update(
+ { _id: card._id },
+ { $set: { swimlaneId } },
+ noValidate
+ );
+ }
+ });
+ });
+});