From 032f842a96d34a6311de9b12701034a55a25fadf Mon Sep 17 00:00:00 2001 From: TheFlow Date: Sun, 12 Oct 2025 16:35:45 +1300 Subject: [PATCH] fix(models): remove duplicate schema indexes for clean startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GovernanceRule: Remove duplicate category index (uses compound index) - VerificationLog: Remove duplicate verifiedAt index (uses compound + TTL) - VariableValue: Remove duplicate category index (standalone index exists) Eliminates 3 Mongoose duplicate index warnings on server startup Server now starts with zero warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/models/GovernanceRule.model.js | 2 +- src/models/VariableValue.model.js | 2 +- src/models/VerificationLog.model.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/GovernanceRule.model.js b/src/models/GovernanceRule.model.js index bc5e6835..37c31ab5 100644 --- a/src/models/GovernanceRule.model.js +++ b/src/models/GovernanceRule.model.js @@ -74,7 +74,7 @@ const governanceRuleSchema = new mongoose.Schema({ type: String, enum: ['content', 'security', 'privacy', 'technical', 'process', 'values', 'other'], default: 'other', - index: true, + // Note: Indexed via compound index { category: 1, active: 1 } below description: 'Category for filtering and organization' }, diff --git a/src/models/VariableValue.model.js b/src/models/VariableValue.model.js index 37c9d693..aad1dd13 100644 --- a/src/models/VariableValue.model.js +++ b/src/models/VariableValue.model.js @@ -58,7 +58,7 @@ const variableValueSchema = new mongoose.Schema({ type: String, enum: ['database', 'security', 'config', 'path', 'url', 'port', 'credential', 'feature_flag', 'other'], default: 'other', - index: true, + // Note: Indexed via standalone index { category: 1 } below description: 'Category for organizing variables' }, diff --git a/src/models/VerificationLog.model.js b/src/models/VerificationLog.model.js index ec644179..f2d897b1 100644 --- a/src/models/VerificationLog.model.js +++ b/src/models/VerificationLog.model.js @@ -201,7 +201,7 @@ const verificationLogSchema = new mongoose.Schema({ verifiedAt: { type: Date, default: Date.now, - index: true, + // Note: Indexed via compound indexes and TTL index below description: 'When verification was performed' }