1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-26 04:28:07 +09:00
hotomoe/tools/migration/like-to-reactions.js
2017-03-20 04:24:19 +09:00

23 lines
333 B
JavaScript

db.users.update({}, {
$unset: {
likes_count: 1,
liked_count: 1
}
}, false, true)
db.likes.renameCollection('post_reactions')
db.post_reactions.update({}, {
$set: {
reaction: 'like'
}
}, false, true)
db.posts.update({}, {
$rename: {
likes_count: 'reaction_counts.like'
}
}, false, true);
db.notifications.remove({})