Update migrate.ts

This commit is contained in:
syuilo 2019-04-24 13:22:36 +09:00 committed by GitHub
parent c2acb9d4a2
commit 747bf3bb85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,7 +195,7 @@ async function main() {
_id: file.metadata.userId _id: file.metadata.userId
}); });
if (user == null) return; if (user == null) return;
if (file.metadata.storage && file.metadata.storage.key) { // when object storage if (file.metadata.storageProps && file.metadata.storageProps.key) { // when object storage
await DriveFiles.save({ await DriveFiles.save({
id: file._id.toHexString(), id: file._id.toHexString(),
userId: user._id.toHexString(), userId: user._id.toHexString(),
@ -208,7 +208,7 @@ async function main() {
size: file.length, size: file.length,
url: file.metadata.url, url: file.metadata.url,
uri: file.metadata.uri, uri: file.metadata.uri,
accessKey: file.metadata.storage.key, accessKey: file.metadata.storageProps.key,
folderId: file.metadata.folderId ? file.metadata.folderId.toHexString() : null, folderId: file.metadata.folderId ? file.metadata.folderId.toHexString() : null,
storedInternal: false, storedInternal: false,
isLink: false isLink: false