diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-04-07 16:26:50 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-07 16:26:50 +0900 |
| commit | 2547891f940a2872fcfb2b33cd33d4f7a42ca7bc (patch) | |
| tree | 5cba4ae9cdfd63e7e1ef74a002a7b742183e8d3c /src/models | |
| parent | Merge pull request #1410 from akihikodaki/objec (diff) | |
| parent | Refactor (diff) | |
| download | misskey-2547891f940a2872fcfb2b33cd33d4f7a42ca7bc.tar.gz misskey-2547891f940a2872fcfb2b33cd33d4f7a42ca7bc.tar.bz2 misskey-2547891f940a2872fcfb2b33cd33d4f7a42ca7bc.zip | |
Merge pull request #1397 from syuilo/refactor
Refactor
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/post-watching.ts | 1 | ||||
| -rw-r--r-- | src/models/post.ts | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/models/post-watching.ts b/src/models/post-watching.ts index b4ddcaafa6..032b9d10fa 100644 --- a/src/models/post-watching.ts +++ b/src/models/post-watching.ts @@ -2,6 +2,7 @@ import * as mongo from 'mongodb'; import db from '../db/mongodb'; const PostWatching = db.get<IPostWatching>('postWatching'); +PostWatching.createIndex(['userId', 'postId'], { unique: true }); export default PostWatching; export interface IPostWatching { diff --git a/src/models/post.ts b/src/models/post.ts index 2f2b51b946..ac7890d2e6 100644 --- a/src/models/post.ts +++ b/src/models/post.ts @@ -27,6 +27,7 @@ export type IPost = { _id: mongo.ObjectID; channelId: mongo.ObjectID; createdAt: Date; + deletedAt: Date; mediaIds: mongo.ObjectID[]; replyId: mongo.ObjectID; repostId: mongo.ObjectID; @@ -52,6 +53,20 @@ export type IPost = { speed: number; }; uri: string; + + _reply?: { + userId: mongo.ObjectID; + }; + _repost?: { + userId: mongo.ObjectID; + }; + _user: { + host: string; + hostLower: string; + account: { + inbox?: string; + }; + }; }; /** |