chore: add indexes for commonly queried data

This commit is contained in:
William Oldham
2026-04-20 21:10:39 +01:00
parent 125b940fad
commit 2e9fb42467

View File

@@ -130,6 +130,11 @@ const PNIDSchema = new Schema<IPNID, PNIDModel, IPNIDMethods>({
}
}, { 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.' });
/*