返回提交历史
Modified
src/models/inboxModel.ts
+2
-0
Modified
src/models/inventoryModels/inventoryModel.ts
+2
-0
Modified
src/models/inventoryModels/loadoutModel.ts
+2
-0
Modified
src/models/personalRoomsModel.ts
+2
-0
Modified
src/models/statsModel.ts
+2
-0
XFEstudio/XFESpaceNinjaServer
chore: add indexes for various models (#1213)
These are looked up by the owner account id and/or assumed to exist only once per account. No index was added for "Ships" as that does not match these critera. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1213
6d12d908
代码差异
5 个文件
+10
-0
@@ -138,4 +138,6 @@ messageSchema.set("toJSON", {
138
138
}
139
139
});
140
140
141
messageSchema.index({ ownerId: 1 });
142
141
143
export const Inbox = model<IMessageDatabase>("Inbox", messageSchema, "inbox");
@@ -1443,6 +1443,8 @@ inventorySchema.set("toJSON", {
1443
1443
}
1444
1444
});
1445
1445
1446
inventorySchema.index({ accountOwnerId: 1 }, { unique: true });
1447
1446
1448
// type overwrites for subdocuments/subdocument arrays
1447
1449
export type InventoryDocumentProps = {
1448
1450
FlavourItems: Types.DocumentArray<IFlavourItem>;
@@ -78,6 +78,8 @@ loadoutSchema.set("toJSON", {
78
78
}
79
79
});
80
80
81
loadoutSchema.index({ loadoutOwnerId: 1 }, { unique: true });
82
81
83
//create database typefor ILoadoutConfig
82
84
type loadoutDocumentProps = {
83
85
NORMAL: Types.DocumentArray<ILoadoutConfigDatabase>;
@@ -152,6 +152,8 @@ export const personalRoomsSchema = new Schema<IPersonalRoomsDatabase>({
152
152
TailorShop: { type: tailorShopSchema, default: tailorShopDefault }
153
153
});
154
154
155
personalRoomsSchema.index({ personalRoomsOwnerId: 1 }, { unique: true });
156
155
157
export const PersonalRooms = model<IPersonalRoomsDatabase, PersonalRoomsModelType>(
156
158
"PersonalRooms",
157
159
personalRoomsSchema
@@ -103,6 +103,8 @@ statsSchema.set("toJSON", {
103
103
}
104
104
});
105
105
106
statsSchema.index({ accountOwnerId: 1 }, { unique: true });
107
106
108
export const Stats = model<IStatsDatabase>("Stats", statsSchema);
107
109
108
110
// eslint-disable-next-line @typescript-eslint/ban-types