mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 17:48:49 +01:00
Add checklist items model, migration and publication
This commit is contained in:
parent
83848dbee2
commit
bf7de463f1
4 changed files with 116 additions and 26 deletions
|
|
@ -187,3 +187,24 @@ Migrations.add('add-views', () => {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
Migrations.add('add-checklist-items', () => {
|
||||
Checklists.find().forEach((checklist) => {
|
||||
// Create new items
|
||||
_.sortBy(checklist.items, 'sort').forEach((item) => {
|
||||
ChecklistItems.direct.insert({
|
||||
title: item.title,
|
||||
sort: item.sort,
|
||||
isFinished: item.isFinished,
|
||||
checklistId: checklist._id,
|
||||
cardId: checklist.cardId,
|
||||
});
|
||||
});
|
||||
|
||||
// Delete old ones
|
||||
Checklists.direct.update({ _id: checklist._id },
|
||||
{ $unset: { items : 1 } },
|
||||
noValidate
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue