This commit is contained in:
syuilo 2018-03-28 16:04:44 +09:00
parent 65069d5fdb
commit bed17efd1b
2 changed files with 30 additions and 10 deletions

View File

@ -20,18 +20,16 @@ export function isValidText(text: string): boolean {
export type IPost = { export type IPost = {
_id: mongo.ObjectID; _id: mongo.ObjectID;
channel_id: mongo.ObjectID; channelId: mongo.ObjectID;
created_at: Date; createdAt: Date;
media_ids: mongo.ObjectID[]; mediaIds: mongo.ObjectID[];
reply_id: mongo.ObjectID; replyId: mongo.ObjectID;
repost_id: mongo.ObjectID; repostId: mongo.ObjectID;
poll: any; // todo poll: any; // todo
text: string; text: string;
user_id: mongo.ObjectID; userId: mongo.ObjectID;
app_id: mongo.ObjectID; appId: mongo.ObjectID;
category: string; viaMobile: boolean;
is_category_verified: boolean;
via_mobile: boolean;
geo: { geo: {
latitude: number; latitude: number;
longitude: number; longitude: number;

View File

@ -156,3 +156,25 @@ db.postReactions.update({}, {
post_id: 'postId' post_id: 'postId'
} }
}, false, true); }, false, true);
db.post_watching.renameCollection('postWatching');
db.postWatching.update({}, {
$rename: {
created_at: 'createdAt',
user_id: 'userId',
post_id: 'postId'
}
}, false, true);
db.posts.update({}, {
$rename: {
created_at: 'createdAt',
channel_id: 'channelId',
user_id: 'userId',
app_id: 'appId',
media_ids: 'mediaIds',
reply_id: 'replyId',
repost_id: 'repostId',
via_mobile: 'viaMobile'
}
}, false, true);