mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-06-06 05:38:13 +08:00
fix: remove duplicate conversation_id unique index (#3713)
Group conversations store one record per owner_user_id and conversation_id pair, so a global unique index on conversation_id breaks group conversation creation with duplicate key errors.
This commit is contained in:
parent
6b3faaef1a
commit
fd61ea4b03
@ -47,12 +47,6 @@ func NewConversationMongo(db *mongo.Database) (*ConversationMgo, error) {
|
|||||||
},
|
},
|
||||||
Options: options.Index(),
|
Options: options.Index(),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Keys: bson.D{
|
|
||||||
{Key: "conversation_id", Value: 1},
|
|
||||||
},
|
|
||||||
Options: options.Index().SetUnique(true),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errs.Wrap(err)
|
return nil, errs.Wrap(err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user