fix: update upload directories
This commit is contained in:
parent
f262fa8069
commit
58864852d1
|
@ -42,8 +42,8 @@ const start = async () => {
|
||||||
console.log('Starting migration, this may take a few minutes...'); // Because I half assed it
|
console.log('Starting migration, this may take a few minutes...'); // Because I half assed it
|
||||||
console.log('Please do NOT kill the process. Wait for it to finish.');
|
console.log('Please do NOT kill the process. Wait for it to finish.');
|
||||||
|
|
||||||
await jetpack.removeAsync(nodePath.join(__dirname, '../../uploads/thumbs'));
|
await jetpack.removeAsync(nodePath.join(__dirname, '../../../uploads/thumbs'));
|
||||||
await jetpack.dirAsync(nodePath.join(__dirname, '../../uploads/thumbs/square'));
|
await jetpack.dirAsync(nodePath.join(__dirname, '../../../uploads/thumbs/square'));
|
||||||
console.log('Finished deleting old thumbnails to create new ones');
|
console.log('Finished deleting old thumbnails to create new ones');
|
||||||
|
|
||||||
const users = await oldDb.table('users').where('username', '<>', 'root');
|
const users = await oldDb.table('users').where('username', '<>', 'root');
|
||||||
|
@ -121,7 +121,7 @@ const start = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const filename = file.name;
|
const filename = file.name;
|
||||||
if (!jetpack.exists(nodePath.join(__dirname, '../../uploads', filename))) continue;
|
if (!jetpack.exists(nodePath.join(__dirname, '../../../uploads', filename))) continue;
|
||||||
ThumbUtil.generateThumbnails(filename);
|
ThumbUtil.generateThumbnails(filename);
|
||||||
}
|
}
|
||||||
await newDb.batchInsert('files', filesToInsert, 20);
|
await newDb.batchInsert('files', filesToInsert, 20);
|
||||||
|
|
Loading…
Reference in New Issue