From b05bee58d28c3209d7f86a909f877c1e121c12ed Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 20 Mar 2017 04:24:19 +0900 Subject: #298 --- tools/migration/like-to-reactions.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tools/migration/like-to-reactions.js (limited to 'tools') 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({}) -- cgit v1.2.3-freya