From f5e74ac471db86266bfc65c251ef82def8525fc6 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sat, 22 Aug 2026 12:56:03 +0100 Subject: [PATCH] Update document template schema to reference object types - Changed the type of `testObject` from Mixed to ObjectId and added a refPath to `objectType`, enhancing the schema's ability to manage relationships with other documents. - This update improves data integrity and allows for more structured querying of related objects. --- src/database/schemas/management/documenttemplate.schema.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/database/schemas/management/documenttemplate.schema.js b/src/database/schemas/management/documenttemplate.schema.js index b3fabe0..4b0c6b9 100644 --- a/src/database/schemas/management/documenttemplate.schema.js +++ b/src/database/schemas/management/documenttemplate.schema.js @@ -45,7 +45,8 @@ const documentTemplateSchema = new Schema( default: '', }, testObject: { - type: Schema.Types.Mixed, + type: Schema.Types.ObjectId, + refPath: 'objectType', required: false, }, },