diff --git a/BuildFeed.Model/BuildRepository.cs b/BuildFeed.Model/BuildRepository.cs index 6c91c48..0c4cf5c 100644 --- a/BuildFeed.Model/BuildRepository.cs +++ b/BuildFeed.Model/BuildRepository.cs @@ -110,6 +110,24 @@ await _buildCollection.Indexes.CreateOneAsync(Builders.IndexKeys.Ascendin Name = "_idx_alt_bstr" }); } + + if (indexes.All(i => i["name"] != "_idx_source")) + { + await _buildCollection.Indexes.CreateOneAsync(Builders.IndexKeys.Ascending(b => b.SourceType), + new CreateIndexOptions + { + Name = "_idx_source" + }); + } + + if (indexes.All(i => i["name"] != "_idx_family")) + { + await _buildCollection.Indexes.CreateOneAsync(Builders.IndexKeys.Ascending(b => b.Family), + new CreateIndexOptions + { + Name = "_idx_family" + }); + } } [DataObjectMethod(DataObjectMethodType.Select, true)]