From 73bb57480b01ece02bdf43866389bc9ef478f271 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 28 Mar 2018 13:13:10 +0900 Subject: wip --- tools/migration/shell.camel-case.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tools/migration') diff --git a/tools/migration/shell.camel-case.js b/tools/migration/shell.camel-case.js index 6d6b01a071..ac0476af0c 100644 --- a/tools/migration/shell.camel-case.js +++ b/tools/migration/shell.camel-case.js @@ -79,3 +79,25 @@ db.following.update({}, { follower_id: 'followerId', } }, false, true); + +db.messaging_histories.renameCollection('messagingHistories'); +db.messagingHistories.update({}, { + $rename: { + updated_at: 'updatedAt', + user_id: 'userId', + partner: 'partnerId', + message: 'messageId', + } +}, false, true); + +db.messaging_messages.renameCollection('messagingMessages'); +db.messagingMessages.update({}, { + $rename: { + created_at: 'createdAt', + user_id: 'userId', + recipient_id: 'recipientId', + file_id: 'fileId', + is_read: 'isRead' + } +}, false, true); + -- cgit v1.2.3-freya