mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Add a migration to add a sort field to the boards model
This commit is contained in:
parent
2400c91013
commit
9f396e9038
1 changed files with 12 additions and 0 deletions
|
@ -1033,3 +1033,15 @@ Migrations.add('add-description-text-allowed', () => {
|
||||||
noValidateMulti,
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue