diff options
Diffstat (limited to 'src/models/post-watching.ts')
| -rw-r--r-- | src/models/post-watching.ts | 1 |
1 files changed, 1 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 { |