update migration to move assets to under user id
This commit is contained in:
parent
a11e37116a
commit
899b5c9710
2 changed files with 7 additions and 1 deletions
|
@ -4,6 +4,7 @@ import path from 'path';
|
|||
import mongoose from 'mongoose';
|
||||
import User from '../models/user';
|
||||
import Project from '../models/project';
|
||||
import async from 'async';
|
||||
require('dotenv').config({path: path.resolve('.env')});
|
||||
mongoose.connect('mongodb://localhost:27017/p5js-web-editor');
|
||||
mongoose.connection.on('error', () => {
|
||||
|
@ -24,6 +25,11 @@ let client = s3.createClient({
|
|||
},
|
||||
});
|
||||
|
||||
const CHUNK = 100;
|
||||
Project.count({}).exec().then((numProjects) => {
|
||||
console.log(numProjects);
|
||||
let index = 0;
|
||||
})
|
||||
Project.find({}, (err, projects) => {
|
||||
projects.forEach((project, projectIndex) => {
|
||||
if (!project.user) return;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
require('babel-register');
|
||||
require('babel-polyfill');
|
||||
require('./moveBucket');
|
||||
require('./s3UnderUser');
|
||||
|
|
Loading…
Reference in a new issue