fix(analytics): remove duplicate sessionId index definition
- SessionSchema had both 'unique: true' and 'index: true' - unique already creates an index, making index redundant - Resolves Mongoose warning about duplicate schema index
This commit is contained in:
parent
a66c5d9016
commit
08a036be3d
2 changed files with 10 additions and 10 deletions
|
|
@ -43,8 +43,8 @@
|
||||||
"last_deliberation": null
|
"last_deliberation": null
|
||||||
},
|
},
|
||||||
"FileEditHook": {
|
"FileEditHook": {
|
||||||
"timestamp": "2025-10-23T21:07:21.094Z",
|
"timestamp": "2025-10-23T21:21:14.842Z",
|
||||||
"file": "/home/theflow/projects/tractatus/src/models/SubmissionTracking.model.js",
|
"file": "/home/theflow/projects/tractatus/src/models/Analytics.model.js",
|
||||||
"result": "passed"
|
"result": "passed"
|
||||||
},
|
},
|
||||||
"FileWriteHook": {
|
"FileWriteHook": {
|
||||||
|
|
@ -58,25 +58,25 @@
|
||||||
"tokens": 30000
|
"tokens": 30000
|
||||||
},
|
},
|
||||||
"alerts": [],
|
"alerts": [],
|
||||||
"last_updated": "2025-10-23T21:07:21.094Z",
|
"last_updated": "2025-10-23T21:21:14.842Z",
|
||||||
"initialized": true,
|
"initialized": true,
|
||||||
"framework_components": {
|
"framework_components": {
|
||||||
"CrossReferenceValidator": {
|
"CrossReferenceValidator": {
|
||||||
"message": 0,
|
"message": 0,
|
||||||
"tokens": 0,
|
"tokens": 0,
|
||||||
"timestamp": "2025-10-23T21:19:30.192Z",
|
"timestamp": "2025-10-23T21:21:26.151Z",
|
||||||
"last_validation": "2025-10-23T21:19:30.191Z",
|
"last_validation": "2025-10-23T21:21:26.150Z",
|
||||||
"validations_performed": 676
|
"validations_performed": 679
|
||||||
},
|
},
|
||||||
"BashCommandValidator": {
|
"BashCommandValidator": {
|
||||||
"message": 0,
|
"message": 0,
|
||||||
"tokens": 0,
|
"tokens": 0,
|
||||||
"timestamp": null,
|
"timestamp": null,
|
||||||
"last_validation": "2025-10-23T21:19:30.193Z",
|
"last_validation": "2025-10-23T21:21:26.152Z",
|
||||||
"validations_performed": 335,
|
"validations_performed": 337,
|
||||||
"blocks_issued": 37
|
"blocks_issued": 37
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"action_count": 335,
|
"action_count": 337,
|
||||||
"auto_compact_events": []
|
"auto_compact_events": []
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +46,7 @@ PageViewSchema.index({ sessionId: 1, timestamp: -1 });
|
||||||
|
|
||||||
// Session Schema
|
// Session Schema
|
||||||
const SessionSchema = new mongoose.Schema({
|
const SessionSchema = new mongoose.Schema({
|
||||||
sessionId: { type: String, required: true, unique: true, index: true },
|
sessionId: { type: String, required: true, unique: true }, // unique already creates index
|
||||||
visitorId: { type: String, required: true, index: true },
|
visitorId: { type: String, required: true, index: true },
|
||||||
|
|
||||||
startTime: { type: Date, default: Date.now },
|
startTime: { type: Date, default: Date.now },
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue