diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-20 04:24:19 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-20 04:24:19 +0900 |
| commit | b05bee58d28c3209d7f86a909f877c1e121c12ed (patch) | |
| tree | 96efc12c89479b63dbc339ab18bcf9dde9dd6bcc /tools | |
| parent | [Client] :art: (diff) | |
| download | sharkey-b05bee58d28c3209d7f86a909f877c1e121c12ed.tar.gz sharkey-b05bee58d28c3209d7f86a909f877c1e121c12ed.tar.bz2 sharkey-b05bee58d28c3209d7f86a909f877c1e121c12ed.zip | |
#298
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({}) |