codebase-models 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,6 +47,6 @@ CVRReportSchema.index({ client: 1 });
|
|
|
47
47
|
// Sparse index for reportLink
|
|
48
48
|
CVRReportSchema.index({ reportLink: 1 }, { sparse: true });
|
|
49
49
|
// TTL index for automatic cleanup of old reports (1 year)
|
|
50
|
-
CVRReportSchema.index({ createdAt: 1 }
|
|
50
|
+
CVRReportSchema.index({ createdAt: 1 });
|
|
51
51
|
const CVRReport = mongoose_1.default.models.cvrreport || (0, mongoose_1.model)("cvrreport", CVRReportSchema);
|
|
52
52
|
exports.default = CVRReport;
|
|
@@ -78,6 +78,6 @@ ClientReportsTempSchema.index({ viewId: 1 }, { sparse: true });
|
|
|
78
78
|
ClientReportsTempSchema.index({ organisationId: 1 }, { sparse: true });
|
|
79
79
|
ClientReportsTempSchema.index({ test: 1 }, { sparse: true });
|
|
80
80
|
// TTL index for automatic cleanup of old reports
|
|
81
|
-
ClientReportsTempSchema.index({ date: 1 }
|
|
81
|
+
ClientReportsTempSchema.index({ date: 1 }); // 24 hours
|
|
82
82
|
const ClientReportsTemp = mongoose_1.default.models.clientreportstemp || (0, mongoose_1.model)("clientreportstemp", ClientReportsTempSchema);
|
|
83
83
|
exports.default = ClientReportsTemp;
|
package/dist/src/models/Test.js
CHANGED
|
@@ -201,6 +201,6 @@ TestSchema.index({ status: 1, enddate: 1 });
|
|
|
201
201
|
TestSchema.index({ status: 1 }, { partialFilterExpression: { status: { $in: ['live', 'running', 'draft', 'paused', 'preview', 'ended'] } } });
|
|
202
202
|
TestSchema.index({ client: 1, status: 1 }, { partialFilterExpression: { status: { $in: ['live', 'running', 'draft', 'paused', 'preview', 'ended'] } } });
|
|
203
203
|
// Add TTL index for automatic cleanup of ended tests after 1 year
|
|
204
|
-
TestSchema.index({ enddate: 1 }
|
|
204
|
+
TestSchema.index({ enddate: 1 });
|
|
205
205
|
const Test = mongoose_1.default.models.test || (0, mongoose_1.model)("test", TestSchema);
|
|
206
206
|
exports.default = Test;
|
package/package.json
CHANGED
package/src/models/CVRReport.ts
CHANGED
|
@@ -35,7 +35,7 @@ CVRReportSchema.index({ client: 1 });
|
|
|
35
35
|
CVRReportSchema.index({ reportLink: 1 }, { sparse: true });
|
|
36
36
|
|
|
37
37
|
// TTL index for automatic cleanup of old reports (1 year)
|
|
38
|
-
CVRReportSchema.index({ createdAt: 1 }
|
|
38
|
+
CVRReportSchema.index({ createdAt: 1 });
|
|
39
39
|
|
|
40
40
|
const CVRReport = mongoose.models.cvrreport || model<ICVRReport>("cvrreport", CVRReportSchema);
|
|
41
41
|
export default CVRReport;
|
|
@@ -73,7 +73,7 @@ ClientReportsTempSchema.index({ organisationId: 1 }, { sparse: true });
|
|
|
73
73
|
ClientReportsTempSchema.index({ test: 1 }, { sparse: true });
|
|
74
74
|
|
|
75
75
|
// TTL index for automatic cleanup of old reports
|
|
76
|
-
ClientReportsTempSchema.index({ date: 1 }
|
|
76
|
+
ClientReportsTempSchema.index({ date: 1 }); // 24 hours
|
|
77
77
|
|
|
78
78
|
const ClientReportsTemp = mongoose.models.clientreportstemp || model<IClientReportsTemp>(
|
|
79
79
|
"clientreportstemp",
|
package/src/models/Test.ts
CHANGED
|
@@ -255,7 +255,7 @@ TestSchema.index({ status: 1 }, { partialFilterExpression: { status: { $in: ['li
|
|
|
255
255
|
TestSchema.index({ client: 1, status: 1 }, { partialFilterExpression: { status: { $in: ['live', 'running', 'draft', 'paused', 'preview', 'ended'] } } });
|
|
256
256
|
|
|
257
257
|
// Add TTL index for automatic cleanup of ended tests after 1 year
|
|
258
|
-
TestSchema.index({ enddate: 1 }
|
|
258
|
+
TestSchema.index({ enddate: 1 });
|
|
259
259
|
|
|
260
260
|
const Test = mongoose.models.test || model<ITest>("test", TestSchema);
|
|
261
261
|
|