Fix migration attachment-cardCopy-fix-boardId-etc. Part 2.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2023-07-10 03:05:55 +03:00
parent c41c26e5a1
commit 8555c24eb2
2 changed files with 94 additions and 39 deletions

View file

@ -1425,7 +1425,7 @@ Migrations.add('attachment-cardCopy-fix-boardId-etc', () => {
Attachments.find( {"meta.source": "copy"} ).forEach(_attachment => {
const cardId = _attachment.meta.cardId;
const card = Cards.findOne(cardId);
if (card.boardId && card.listId && card.swimlaneId) {
if (card.boardId !== undefined && card.listId !== undefined && card.swimlaneId !== undefined) {
console.log("update attachment id: ", _attachment._id);
Attachments.update(_attachment._id, {
$set: {