From 6f3f08ed340e59a62a2d0428a5c32f99551ef1ce Mon Sep 17 00:00:00 2001 From: Rory& Date: Tue, 3 Jun 2025 01:01:40 +0200 Subject: Fix performance issues, add fake user bot to test client, more testing --- src/db/schemas/user.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/db/schemas/user.js') diff --git a/src/db/schemas/user.js b/src/db/schemas/user.js index 7680319..7a4b2f4 100644 --- a/src/db/schemas/user.js +++ b/src/db/schemas/user.js @@ -30,18 +30,21 @@ export const deviceSchema = new Schema({ } }); -export const alarmSchema = new Schema({ - createdAt: { - type: Date, - default: Date.now, - immutable: true +export const alarmSchema = new Schema( + { + reason: { + type: String, + enum: Object.values(AlarmType), + required: true + } }, - reason: { - type: String, - enum: Object.values(AlarmType), - required: true + { + timestamps: { + createdAt: true, + updatedAt: false + } } -}); +); /** * User schema for MongoDB. -- cgit 1.5.1