From b44227948d6a283e2f2579111f40d3f7460da31a Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 21 Jan 2019 21:45:11 +0900 Subject: [PATCH] Add unique index #3946 --- src/models/poll-vote.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/poll-vote.ts b/src/models/poll-vote.ts index 4390e000c3..b8aceae3b0 100644 --- a/src/models/poll-vote.ts +++ b/src/models/poll-vote.ts @@ -4,6 +4,7 @@ import db from '../db/mongodb'; const PollVote = db.get('pollVotes'); PollVote.createIndex('userId'); PollVote.createIndex('noteId'); +PollVote.createIndex(['userId', 'noteId'], { unique: true }); export default PollVote; export interface IPollVote {