Showing
1 changed file
with
5 additions
and
0 deletions
... | @@ -2,3 +2,8 @@ const config = require('./config'); | ... | @@ -2,3 +2,8 @@ const config = require('./config'); |
2 | const db = require('monk')(config.db); | 2 | const db = require('monk')(config.db); |
3 | 3 | ||
4 | module.exports = db; | 4 | module.exports = db; |
5 | + | ||
6 | +db.then(async() => { | ||
7 | + await db.get('board').createIndex({name: 1}, {unique: true}); | ||
8 | + await db.get('thread').createIndex({board: 1, lastUpdated: -1}); | ||
9 | +}); | ... | ... |
-
Please register or login to post a comment