diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-01-21 21:45:11 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-01-21 21:45:11 +0900 |
| commit | b44227948d6a283e2f2579111f40d3f7460da31a (patch) | |
| tree | 006752b372c606076aa83db464a8aa3929e889d3 /src/models | |
| parent | [Client] Fix #3321 (diff) | |
| download | misskey-b44227948d6a283e2f2579111f40d3f7460da31a.tar.gz misskey-b44227948d6a283e2f2579111f40d3f7460da31a.tar.bz2 misskey-b44227948d6a283e2f2579111f40d3f7460da31a.zip | |
Add unique index
#3946
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/poll-vote.ts | 1 |
1 files changed, 1 insertions, 0 deletions
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<IPollVote>('pollVotes'); PollVote.createIndex('userId'); PollVote.createIndex('noteId'); +PollVote.createIndex(['userId', 'noteId'], { unique: true }); export default PollVote; export interface IPollVote { |