Make migration scripts

and use createdAt instead of _id
This commit is contained in:
syuilo 2018-04-02 23:19:07 +09:00
parent 5b80b6e901
commit 5ce6fa67d2
7 changed files with 90 additions and 4 deletions

View file

@ -24,6 +24,7 @@ export default ({ data }, done) => Following.findOne({ _id: data.following }).th
}),
promisedFollower.then(({ followingCount }) => FollowingLog.insert({
createdAt: data.following.createdAt,
userId: followerId,
count: followingCount + 1
})),
@ -36,6 +37,7 @@ export default ({ data }, done) => Following.findOne({ _id: data.following }).th
}),
promisedFollowee.then(({ followersCount }) => FollowedLog.insert({
createdAt: data.following.createdAt,
userId: followerId,
count: followersCount + 1
})),