Skip to content

Commit ae94ecb

Browse files
committed
Fix index
1 parent 5ae4acb commit ae94ecb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/providers/WorkflowCore.Persistence.MongoDB/Services/MongoPersistenceProvider.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,16 @@ static void CreateIndexes(MongoPersistenceProvider instance)
112112
instance.EventSubscriptions.Indexes.CreateOne(new CreateIndexModel<EventSubscription>(
113113
Builders<EventSubscription>.IndexKeys
114114
.Ascending(x => x.EventKey)
115-
.Ascending(x => x.EventName)
116-
.Ascending(x => x.SubscribeAsOf)
117-
.Ascending(x => x.ExternalToken),
115+
.Ascending(x => x.EventName),
118116
new CreateIndexOptions { Background = true, Name = "idx_namekey_v2" }));
117+
118+
instance.EventSubscriptions.Indexes.CreateOne(new CreateIndexModel<EventSubscription>(
119+
Builders<EventSubscription>.IndexKeys.Ascending(x => x.SubscribeAsOf),
120+
new CreateIndexOptions { Background = true, Name = "idx_subscribe" }));
121+
122+
instance.EventSubscriptions.Indexes.CreateOne(new CreateIndexModel<EventSubscription>(
123+
Builders<EventSubscription>.IndexKeys.Ascending(x => x.ExternalToken),
124+
new CreateIndexOptions { Background = true, Name = "idx_token" }));
119125

120126
instance.ScheduledCommands.Indexes.CreateOne(new CreateIndexModel<ScheduledCommand>(
121127
Builders<ScheduledCommand>.IndexKeys

0 commit comments

Comments
 (0)