diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/migration/like-to-reactions.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/migration/like-to-reactions.js b/tools/migration/like-to-reactions.js new file mode 100644 index 0000000000..962a0f00ef --- /dev/null +++ b/tools/migration/like-to-reactions.js @@ -0,0 +1,22 @@ +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({}) |