mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Try to fix attachment migrations to ostrioFiles, allow existing files to be migrated. Part 2.
Thanks to xet7 ! Related #4780, related https://github.com/wekan/wekan/pull/4648
This commit is contained in:
parent
1aa5c23bba
commit
16ad6bf9fc
2 changed files with 31 additions and 27 deletions
|
@ -1246,6 +1246,7 @@ Migrations.add('add-card-details-show-lists', () => {
|
|||
});
|
||||
|
||||
Migrations.add('migrate-attachments-collectionFS-to-ostrioFiles', () => {
|
||||
Meteor.settings.public.ostrioFilesMigrationInProgress = "true";
|
||||
AttachmentsOld.find().forEach(function(fileObj) {
|
||||
const newFileName = fileObj.name();
|
||||
const storagePath = Attachments.storagePath({});
|
||||
|
@ -1306,9 +1307,11 @@ Migrations.add('migrate-attachments-collectionFS-to-ostrioFiles', () => {
|
|||
|
||||
readStream.pipe(writeStream);
|
||||
});
|
||||
Meteor.settings.public.ostrioFilesMigrationInProgress = "false";
|
||||
});
|
||||
|
||||
Migrations.add('migrate-avatars-collectionFS-to-ostrioFiles', () => {
|
||||
Meteor.settings.public.ostrioFilesMigrationInProgress = "true";
|
||||
AvatarsOld.find().forEach(function(fileObj) {
|
||||
const newFileName = fileObj.name();
|
||||
const storagePath = Avatars.storagePath({});
|
||||
|
@ -1386,6 +1389,7 @@ Migrations.add('migrate-avatars-collectionFS-to-ostrioFiles', () => {
|
|||
|
||||
readStream.pipe(writeStream);
|
||||
});
|
||||
Meteor.settings.public.ostrioFilesMigrationInProgress = "false";
|
||||
});
|
||||
|
||||
Migrations.add('migrate-attachment-drop-index-cardId', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue