chore: add indexes for various models #1213
@ -138,4 +138,6 @@ messageSchema.set("toJSON", {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					messageSchema.index({ ownerId: 1 });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const Inbox = model<IMessageDatabase>("Inbox", messageSchema, "inbox");
 | 
					export const Inbox = model<IMessageDatabase>("Inbox", messageSchema, "inbox");
 | 
				
			||||||
 | 
				
			|||||||
@ -1443,6 +1443,8 @@ inventorySchema.set("toJSON", {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inventorySchema.index({ accountOwnerId: 1 }, { unique: true });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// type overwrites for subdocuments/subdocument arrays
 | 
					// type overwrites for subdocuments/subdocument arrays
 | 
				
			||||||
export type InventoryDocumentProps = {
 | 
					export type InventoryDocumentProps = {
 | 
				
			||||||
    FlavourItems: Types.DocumentArray<IFlavourItem>;
 | 
					    FlavourItems: Types.DocumentArray<IFlavourItem>;
 | 
				
			||||||
 | 
				
			|||||||
@ -78,6 +78,8 @@ loadoutSchema.set("toJSON", {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					loadoutSchema.index({ loadoutOwnerId: 1 }, { unique: true });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//create database typefor ILoadoutConfig
 | 
					//create database typefor ILoadoutConfig
 | 
				
			||||||
type loadoutDocumentProps = {
 | 
					type loadoutDocumentProps = {
 | 
				
			||||||
    NORMAL: Types.DocumentArray<ILoadoutConfigDatabase>;
 | 
					    NORMAL: Types.DocumentArray<ILoadoutConfigDatabase>;
 | 
				
			||||||
 | 
				
			|||||||
@ -152,6 +152,8 @@ export const personalRoomsSchema = new Schema<IPersonalRoomsDatabase>({
 | 
				
			|||||||
    TailorShop: { type: tailorShopSchema, default: tailorShopDefault }
 | 
					    TailorShop: { type: tailorShopSchema, default: tailorShopDefault }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					personalRoomsSchema.index({ personalRoomsOwnerId: 1 }, { unique: true });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const PersonalRooms = model<IPersonalRoomsDatabase, PersonalRoomsModelType>(
 | 
					export const PersonalRooms = model<IPersonalRoomsDatabase, PersonalRoomsModelType>(
 | 
				
			||||||
    "PersonalRooms",
 | 
					    "PersonalRooms",
 | 
				
			||||||
    personalRoomsSchema
 | 
					    personalRoomsSchema
 | 
				
			||||||
 | 
				
			|||||||
@ -103,6 +103,8 @@ statsSchema.set("toJSON", {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					statsSchema.index({ accountOwnerId: 1 }, { unique: true });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const Stats = model<IStatsDatabase>("Stats", statsSchema);
 | 
					export const Stats = model<IStatsDatabase>("Stats", statsSchema);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// eslint-disable-next-line @typescript-eslint/ban-types
 | 
					// eslint-disable-next-line @typescript-eslint/ban-types
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user