mirror of
https://github.com/wekan/wekan.git
synced 2025-12-28 21:28:49 +01:00
add cardNumber handling to card and board model
This commit is contained in:
parent
36c2cb9573
commit
b57eae14d4
3 changed files with 72 additions and 0 deletions
|
|
@ -1061,3 +1061,36 @@ Migrations.add('add-hide-logo-by-default', () => {
|
|||
noValidateMulti,
|
||||
);
|
||||
});
|
||||
|
||||
Migrations.add('add-card-number-allowed', () => {
|
||||
Boards.update(
|
||||
{
|
||||
allowsCardNumber: {
|
||||
$exists: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
allowsCardNumber: false,
|
||||
},
|
||||
},
|
||||
noValidateMulti,
|
||||
);
|
||||
});
|
||||
|
||||
Migrations.add('assign-boardwise-card-numbers', () => {
|
||||
Boards.find().forEach(board => {
|
||||
let nextCardNumber = 1;
|
||||
Cards.find(
|
||||
{
|
||||
boardId: board._id,
|
||||
cardNumber: {
|
||||
$exists: false
|
||||
}
|
||||
}
|
||||
).forEach(card => {
|
||||
Cards.update(card._id, { $set: { cardNumber } }, noValidate);
|
||||
nextCardNumber++;
|
||||
});
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue