From 3b36cd1e9cd5b0e990a203b77a0d8e884298038b Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Tue, 11 Jul 2017 11:50:23 -0400 Subject: [PATCH] fix asset migration script --- server/migrations/s3UnderUser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/migrations/s3UnderUser.js b/server/migrations/s3UnderUser.js index a0fbb967..107d524e 100644 --- a/server/migrations/s3UnderUser.js +++ b/server/migrations/s3UnderUser.js @@ -29,7 +29,7 @@ Project.find({}, (err, projects) => { if (!project.user) return; const userId = project.user.valueOf(); project.files.forEach((file, fileIndex) => { - if (file.url && file.url.includes(process.env.S3_BUCKET)) { + if (file.url && file.url.includes(process.env.S3_BUCKET) && !file.url.includes(userId)) { const key = file.url.split('/').pop(); console.log(key); const params = {