mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Mig: add migration cfs:* -> ostrio:files
This commit is contained in:
parent
e702f17c7b
commit
2dc6e15024
1 changed files with 35 additions and 0 deletions
|
@ -1119,3 +1119,38 @@ Migrations.add('add-card-details-show-lists', () => {
|
|||
noValidateMulti,
|
||||
);
|
||||
});
|
||||
|
||||
Migrations.add(
|
||||
'adapt-attachments-to-ostrio-files-api-using-meta-and-drp-cfs-leacy',
|
||||
() => {
|
||||
Attachments.find().forEach(file => {
|
||||
Attachments.update(
|
||||
file._id,
|
||||
{
|
||||
$set: {
|
||||
'meta.boardId': file.boardId,
|
||||
'meta.cardId': file.cardId,
|
||||
'meta.listId': file.listId,
|
||||
'meta.swimlaneId': file.swimlaneId,
|
||||
},
|
||||
},
|
||||
noValidate,
|
||||
);
|
||||
});
|
||||
Attachments.update(
|
||||
{},
|
||||
{
|
||||
$unset: {
|
||||
original: '', // cfs:* legacy
|
||||
copies: '', // cfs:* legacy
|
||||
failures: '', // cfs:* legacy
|
||||
boardId: '',
|
||||
cardId: '',
|
||||
listId: '',
|
||||
swimlaneId: '',
|
||||
},
|
||||
},
|
||||
noValidateMulti,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue