summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorboeserwolf <github@noxware.de>2020-04-19 10:51:58 +0300
committerboeserwolf <github@noxware.de>2020-04-19 10:51:58 +0300
commit9f396e9038712e0223cbd47b7bc14253610f9af9 (patch)
treebf22fde5c6f3b2a028f61d73f214c44daefe2bac /server
parent2400c910135dbcdddd82954951fc3a970748af55 (diff)
downloadwekan-9f396e9038712e0223cbd47b7bc14253610f9af9.tar.gz
wekan-9f396e9038712e0223cbd47b7bc14253610f9af9.tar.bz2
wekan-9f396e9038712e0223cbd47b7bc14253610f9af9.zip
Add a migration to add a sort field to the boards model
Diffstat (limited to 'server')
-rw-r--r--server/migrations.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/migrations.js b/server/migrations.js
index b4489987..21b54bda 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -1033,3 +1033,15 @@ Migrations.add('add-description-text-allowed', () => {
noValidateMulti,
);
});
+
+Migrations.add('add-sort-field-to-boards', () => {
+ Boards.find().forEach((board, index) => {
+ if (!board.hasOwnProperty('sort')) {
+ Boards.direct.update(
+ board._id,
+ { $set: { sort: index } },
+ noValidate
+ );
+ }
+ });
+});