mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
attachment copy changes now the boardId, listId and swimlaneId in the collection data
- fixing admin attachment view, copied card attachments were wrong if copied to another board / list / swimlane
This commit is contained in:
parent
0261bb592e
commit
2eadd3eb8b
2 changed files with 19 additions and 3 deletions
|
|
@ -1420,3 +1420,18 @@ Migrations.add('migrate-attachment-migration-fix-source-import', () => {
|
|||
noValidateMulti
|
||||
);
|
||||
});
|
||||
|
||||
Migrations.add('attachment-cardCopy-fix-boardId-etc', () => {
|
||||
Attachments.find( {"meta.source": "copy"} ).forEach(_attachment => {
|
||||
const cardId = _attachment.meta.cardId;
|
||||
const card = Cards.findOne(cardId);
|
||||
console.log("update attachment id: ", _attachment._id);
|
||||
Attachments.update(_attachment._id, {
|
||||
$set: {
|
||||
"meta.boardId": card.boardId,
|
||||
"meta.listId": card.listId,
|
||||
"meta.swimlaneId": card.swimlaneId,
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue