add unique index on slackChannelId in BoardChannel model

This commit is contained in:
Jennie Robinson Faber 2026-04-14 16:23:23 +01:00
parent 1da59021a3
commit 8e5f4a2d7c

View file

@ -6,4 +6,6 @@ const boardChannelSchema = new mongoose.Schema({
tagSlugs: [String], tagSlugs: [String],
}, { timestamps: true }) }, { timestamps: true })
boardChannelSchema.index({ slackChannelId: 1 }, { unique: true })
export default mongoose.models.BoardChannel || mongoose.model('BoardChannel', boardChannelSchema) export default mongoose.models.BoardChannel || mongoose.model('BoardChannel', boardChannelSchema)