summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-03 01:37:43 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-03 01:37:43 +0900
commit1332adf12b8325b00df44ae13d21f9702fc91cc4 (patch)
tree0bb2133572f9fd2f015b8c1ad45cb2daf9253324
parentRevert "[wip] Implement like activity" (diff)
downloadmisskey-1332adf12b8325b00df44ae13d21f9702fc91cc4.tar.gz
misskey-1332adf12b8325b00df44ae13d21f9702fc91cc4.tar.bz2
misskey-1332adf12b8325b00df44ae13d21f9702fc91cc4.zip
Use index
Diffstat (limited to '')
-rw-r--r--src/models/post-reaction.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/models/post-reaction.ts b/src/models/post-reaction.ts
index 3fc33411fb..81be95b8d8 100644
--- a/src/models/post-reaction.ts
+++ b/src/models/post-reaction.ts
@@ -5,12 +5,12 @@ import Reaction from './post-reaction';
import { pack as packUser } from './user';
const PostReaction = db.get<IPostReaction>('postReactions');
+PostReaction.createIndex(['userId', 'postId'], { unique: true });
export default PostReaction;
export interface IPostReaction {
_id: mongo.ObjectID;
createdAt: Date;
- deletedAt: Date;
postId: mongo.ObjectID;
userId: mongo.ObjectID;
reaction: string;