From 8e5f4a2d7c0b6c1cc8343d333e3ec9858f21d56f Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Tue, 14 Apr 2026 16:23:23 +0100 Subject: [PATCH] add unique index on slackChannelId in BoardChannel model --- server/models/boardChannel.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/models/boardChannel.js b/server/models/boardChannel.js index d3b1255..dc4a599 100644 --- a/server/models/boardChannel.js +++ b/server/models/boardChannel.js @@ -6,4 +6,6 @@ const boardChannelSchema = new mongoose.Schema({ tagSlugs: [String], }, { timestamps: true }) +boardChannelSchema.index({ slackChannelId: 1 }, { unique: true }) + export default mongoose.models.BoardChannel || mongoose.model('BoardChannel', boardChannelSchema)