summaryrefslogtreecommitdiff
path: root/tools/migration
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-08 16:13:25 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-08 16:13:25 +0900
commitbb29f462e20f97005925a22f9db4aae8a146c669 (patch)
tree5ae7b5b3a066c60f9387fe1b5c6c6115a12bda6c /tools/migration
parentoops (diff)
downloadsharkey-bb29f462e20f97005925a22f9db4aae8a146c669.tar.gz
sharkey-bb29f462e20f97005925a22f9db4aae8a146c669.tar.bz2
sharkey-bb29f462e20f97005925a22f9db4aae8a146c669.zip
oops
Diffstat (limited to 'tools/migration')
-rw-r--r--tools/migration/nighthike/4.js41
1 files changed, 29 insertions, 12 deletions
diff --git a/tools/migration/nighthike/4.js b/tools/migration/nighthike/4.js
index f308341f0c..d77c91ca80 100644
--- a/tools/migration/nighthike/4.js
+++ b/tools/migration/nighthike/4.js
@@ -178,8 +178,22 @@ db.posts.update({}, {
via_mobile: 'viaMobile',
reaction_counts: 'reactionCounts',
replies_count: 'repliesCount',
- repost_count: 'repostCount',
+ repost_count: 'repostCount'
+ }
+}, false, true);
+
+db.posts.update({
+ _reply: { $ne: null }
+}, {
+ $rename: {
'_reply.user_id': '_reply.userId',
+ }
+}, false, true);
+
+db.posts.update({
+ _repost: { $ne: null }
+}, {
+ $rename: {
'_repost.user_id': '_repost.userId',
}
}, false, true);
@@ -199,6 +213,20 @@ db.swSubscriptions.update({}, {
}, false, true);
db.users.update({}, {
+ $unset: {
+ likes_count: '',
+ liked_count: '',
+ latest_post: '',
+ 'account.twitter.access_token': '',
+ 'account.twitter.access_token_secret': '',
+ 'account.twitter.user_id': '',
+ 'account.twitter.screen_name': '',
+ 'account.line.user_id': '',
+ 'account.client_settings.mobile_home': ''
+ }
+}, false, true);
+
+db.users.update({}, {
$rename: {
created_at: 'createdAt',
deleted_at: 'deletedAt',
@@ -218,16 +246,5 @@ db.users.update({}, {
'account.two_factor_secret': 'account.twoFactorSecret',
'account.two_factor_enabled': 'account.twoFactorEnabled',
'account.client_settings': 'account.clientSettings'
- },
- $unset: {
- likes_count: '',
- liked_count: '',
- latest_post: '',
- 'account.twitter.access_token': '',
- 'account.twitter.access_token_secret': '',
- 'account.twitter.user_id': '',
- 'account.twitter.screen_name': '',
- 'account.line.user_id': '',
- 'account.client_settings.mobile_home': ''
}
}, false, true);