fix: add state enums to Connection matchingTags, index to TagSuggestion
This commit is contained in:
parent
8112e5ea47
commit
4b6ff19d5f
2 changed files with 4 additions and 2 deletions
|
|
@ -7,8 +7,8 @@ const connectionSchema = new mongoose.Schema({
|
||||||
matchingTags: [
|
matchingTags: [
|
||||||
{
|
{
|
||||||
tagSlug: String,
|
tagSlug: String,
|
||||||
initiatorState: String,
|
initiatorState: { type: String, enum: ['help', 'interested', 'seeking'] },
|
||||||
recipientState: String,
|
recipientState: { type: String, enum: ['help', 'interested', 'seeking'] },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
hiddenBy: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Member' }],
|
hiddenBy: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Member' }],
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,6 @@ const tagSuggestionSchema = new mongoose.Schema({
|
||||||
createdAt: { type: Date, default: Date.now },
|
createdAt: { type: Date, default: Date.now },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
tagSuggestionSchema.index({ pool: 1, status: 1 })
|
||||||
|
|
||||||
export default mongoose.models.TagSuggestion || mongoose.model('TagSuggestion', tagSuggestionSchema)
|
export default mongoose.models.TagSuggestion || mongoose.model('TagSuggestion', tagSuggestionSchema)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue