# use prod_ln_scene;

# 创建集合
db.createCollection("SlimeFieldsVo");
db.createCollection("SlimeFieldAppliesVo");
db.createCollection("SlimeFieldCheckersVo");
db.createCollection("SlimeSponsorsVo");
db.createCollection("SlimeSponsorAppliesVo");
db.createCollection("SlimeAuthorizationRecordsVo");
db.createCollection("SlimeAuthorizationPerformanceVo");


# 创建索引
db.SlimeFieldsVo.createIndex({fieldId:"hashed"});
db.SlimeFieldsVo.createIndex({isOnline:"hashed"});
db.SlimeFieldsVo.createIndex({uid:"hashed"});
db.SlimeFieldsVo.createIndex({companyId:"hashed"});
db.SlimeFieldAppliesVo.createIndex({fieldApplyId:"hashed"})
db.SlimeFieldAppliesVo.createIndex({fieldId:"hashed"});
db.SlimeFieldAppliesVo.createIndex({uid:"hashed"});
db.SlimeFieldCheckersVo.createIndex({fieldCheckerId:"hashed"});
db.SlimeFieldCheckersVo.createIndex({fieldId:"hashed"});
db.SlimeFieldCheckersVo.createIndex({uid:"hashed"});
db.SlimeSponsorsVo.createIndex({sponsorId:"hashed"});
db.SlimeSponsorsVo.createIndex({isOnline:"hashed"});
db.SlimeSponsorsVo.createIndex({uid:"hashed"});
db.SlimeSponsorsVo.createIndex({companyId:"hashed"});
db.SlimeSponsorAppliesVo.createIndex({sponsorApplyId:"hashed"});
db.SlimeSponsorAppliesVo.createIndex({sponsorId:"hashed"});
db.SlimeSponsorAppliesVo.createIndex({uid:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({authorizationRecordId:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({performanceId:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({uidRole:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({uid:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({cuidRole:"hashed"});
db.SlimeAuthorizationRecordsVo.createIndex({cuid:"hashed"});
db.SlimeAuthorizationPerformanceVo.createIndex({performanceId:"hashed"});
db.SlimeAuthorizationPerformanceVo.createIndex({uid:"hashed"});

db.KylinPerformanceVo.createIndex({merchantId:"hashed"});
db.KylinOrderTicketVo.createIndex({status:"hashed"});
db.KylinOrderTicketVo.createIndex({transferStatus:"hashed"});

#创建分片
sh.enableSharding("prod_ln_scene");
sh.shardCollection("prod_ln_scene.SlimeFieldsVo",{"fieldId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeFieldAppliesVo",{"fieldApplyId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeFieldCheckersVo",{"fieldCheckId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeSponsorsVo",{"sponsorId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeSponsorAppliesVo",{"sponsorApplyId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeAuthorizationRecordsVo",{"authorizationRecordId":"hashed"});
sh.shardCollection("prod_ln_scene.SlimeAuthorizationPerformanceVo",{"performanceId":"hashed"});


