diff --git a/src/models/pnid.ts b/src/models/pnid.ts index a3af546..bca37bb 100644 --- a/src/models/pnid.ts +++ b/src/models/pnid.ts @@ -130,6 +130,11 @@ const PNIDSchema = new Schema({ } }, { id: false }); +PNIDSchema.index({ pid: 1 }); +PNIDSchema.index({ usernameLower: 1 }); +// Used for the admin panel querying +PNIDSchema.index({ 'pid': 1, 'username': 1, 'connections.discord.id': 1 }); + PNIDSchema.plugin(uniqueValidator, { message: '{PATH} already in use.' }); /*