You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/12/11 02:10:04 UTC

[GitHub] [servicecomb-service-center] DFSOrange commented on a change in pull request #779: SCB-2094 add schema/rule/service ut

DFSOrange commented on a change in pull request #779:
URL: https://github.com/apache/servicecomb-service-center/pull/779#discussion_r538256643



##########
File path: datasource/mongo/mongo.go
##########
@@ -88,3 +97,24 @@ func (ds *DataSource) initClient() error {
 		return nil
 	}
 }
+
+func (ds *DataSource) createIndexes() (err error) {
+	err = client.GetMongoClient().CreateIndexes(context.TODO(), CollectionService, []mongo.IndexModel{{
+		Keys:    bsonx.Doc{{Key: StringBuilder([]string{ColumnServiceInfo, ColumnServiceID}), Value: bsonx.Int32(1)}},

Review comment:
       > 微服务信息,应该有个app,version servicename,env唯一约束,这个索引是否做了
   
   嗯,就是106行的下一个索引,name+verison+alias+appid+env的唯一索引




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org