fix: add databases indexes so things aren't slow™️
Some checks failed
Build and Publish Docker Image / build-publish (push) Has been cancelled

This commit is contained in:
William Oldham 2025-03-24 20:16:57 +00:00
parent 00ceec5b46
commit 837cccd04f
2 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,9 @@ const CECDataSchema = new mongoose.Schema<ICECData, CECDataModel, ICECDataMethod
data: String,
data_hash: String,
size: Number,
created: BigInt
created: { type: BigInt, index: true }
});
CECDataSchema.index({ creator_pid: 1, game_id: 1 });
export const CECData = mongoose.model<ICECData, CECDataModel>('CECData', CECDataSchema);

View File

@ -7,4 +7,6 @@ const CECSlotSchema = new mongoose.Schema<ICECSlot, CECSlotModel, ICECSlotMethod
latest_data_id: String
});
CECSlotSchema.index({ creator_pid: 1, game_id: 1 });
export const CECSlot = mongoose.model<ICECSlot, CECSlotModel>('CECSlot', CECSlotSchema);