XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 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
Sainan <sainan@calamity.inc>
提交于

代码差异

5 个文件 +10 -0
Modified src/models/inboxModel.ts +2 -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");
Modified src/models/inventoryModels/inventoryModel.ts +2 -0
@@ -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>;
Modified src/models/inventoryModels/loadoutModel.ts +2 -0
@@ -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>;
Modified src/models/personalRoomsModel.ts +2 -0
@@ -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
Modified src/models/statsModel.ts +2 -0
@@ -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