diff --git a/server/scripts/set-indexes.ts b/server/scripts/set-indexes.ts index 91ab35339..4f37f73c2 100644 --- a/server/scripts/set-indexes.ts +++ b/server/scripts/set-indexes.ts @@ -32,6 +32,10 @@ const UNIQUE = { unique: true }; const indexes: Partial> = { scores: [index({ scoreID: 1 }, UNIQUE)], + "score-pbs": [ + index({ chartID: 1, userID: 1 }, UNIQUE), + index({ chartID: 1, "scoreData.percent": 1 }), + ], "charts-iidx": [ index({ chartID: 1 }, UNIQUE), index({ songID: 1, difficulty: 1, playtype: 1, isPrimary: 1 }, UNIQUE), @@ -52,7 +56,7 @@ const indexes: Partial> = { await db.get(collection).dropIndexes(); } - // @ts-expect-error yeah blah blah + // @ts-expect-error ??? for (const index of indexes[collection]) { // eslint-disable-next-line no-await-in-loop let r = await db.get(collection).createIndex(index.fields, index.options);