ensure the presence of an index in WIND_TRACKS by event name

This commit is contained in:
Axel Uhl committed 2012-03-09 23:40:18 +01:00
1 parent edd8e37863
commit 6051b3a972
1 file changed
+3 -1
@@ -79,7 +79,9 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
}
public DBCollection getWindTrackCollection() {
return database.getCollection(CollectionNames.WIND_TRACKS.name());
DBCollection result = database.getCollection(CollectionNames.WIND_TRACKS.name());
result.ensureIndex(new BasicDBObject(FieldNames.EVENT_NAME.name(), null));
return result;
}
public DBObject storeWindTrackEntry(Event event, RaceDefinition race, WindSource windSource, Wind wind) {