diff --git a/src/api/models/user.ts b/src/api/models/user.ts index e73c95faf2..9aa7c4efae 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -46,7 +46,7 @@ export type ILocalAccount = { password: string; token: string; twitter: { - access_token: string; + accessToken: string; access_token_secret: string; user_id: string; screen_name: string; diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index 96e0495709..29d75b62f9 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -115,8 +115,6 @@ export default async (req: express.Request, res: express.Response) => { following_count: 0, name: name, posts_count: 0, - likes_count: 0, - liked_count: 0, drive_capacity: 1073741824, // 1GB username: username, username_lower: username.toLowerCase(), diff --git a/tools/migration/shell.camel-case.js b/tools/migration/shell.camel-case.js index 9cb0baaaf5..afe831e5b7 100644 --- a/tools/migration/shell.camel-case.js +++ b/tools/migration/shell.camel-case.js @@ -194,3 +194,36 @@ db.swSubscriptions.update({}, { user_id: 'userId', } }, false, true); + +db.users.update({}, { + $rename: { + created_at: 'createdAt', + deleted_at: 'deletedAt', + followers_count: 'followersCount', + following_count: 'followingCount', + posts_count: 'postsCount', + drive_capacity: 'driveCapacity', + username_lower: 'usernameLower', + avatar_id: 'avatarId', + banner_id: 'bannerId', + pinned_post_id: 'pinnedPostId', + is_suspended: 'isSuspended', + host_lower: 'hostLower', + 'twitter.access_token': 'twitter.accessToken', + 'twitter.access_token_secret': 'twitter.accessTokenSecret', + 'twitter.user_id': 'twitter.userId', + 'twitter.screen_name': 'twitter.screenName', + 'line.user_id': 'line.userId', + last_used_at: 'lastUsedAt', + is_bot: 'isBot', + is_pro: 'isPro', + two_factor_secret: 'twoFactorSecret', + two_factor_enabled: 'twoFactorEnabled', + client_settings: 'clientSettings' + }, + $unset: { + likes_count: '', + liked_count: '', + latest_post: '' + } +}, false, true);