Mongo collection for SMSVerificationRequest model
This commit is contained in:
parent
0af78479fc
commit
043af08bf0
|
@ -119,6 +119,15 @@ func NewProvider() (*provider, error) {
|
|||
},
|
||||
}, options.CreateIndexes())
|
||||
|
||||
mongodb.CreateCollection(ctx, models.Collections.SMSVerificationRequest, options.CreateCollection())
|
||||
smsCollection := mongodb.Collection(models.Collections.SMSVerificationRequest, options.Collection())
|
||||
smsCollection.Indexes().CreateMany(ctx, []mongo.IndexModel{
|
||||
{
|
||||
Keys: bson.M{"phone_number": 1},
|
||||
Options: options.Index().SetUnique(true).SetSparse(true),
|
||||
},
|
||||
}, options.CreateIndexes())
|
||||
|
||||
return &provider{
|
||||
db: mongodb,
|
||||
}, nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user