diff options
author | boeserwolf <github@noxware.de> | 2020-04-19 10:51:58 +0300 |
---|---|---|
committer | boeserwolf <github@noxware.de> | 2020-04-19 10:51:58 +0300 |
commit | 9f396e9038712e0223cbd47b7bc14253610f9af9 (patch) | |
tree | bf22fde5c6f3b2a028f61d73f214c44daefe2bac | |
parent | 2400c910135dbcdddd82954951fc3a970748af55 (diff) | |
download | wekan-9f396e9038712e0223cbd47b7bc14253610f9af9.tar.gz wekan-9f396e9038712e0223cbd47b7bc14253610f9af9.tar.bz2 wekan-9f396e9038712e0223cbd47b7bc14253610f9af9.zip |
Add a migration to add a sort field to the boards model
-rw-r--r-- | server/migrations.js | 12 |
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 + ); + } + }); +}); |