Skip to content

Commit

Permalink
Add a perf-importent Notification index (#16590)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Aug 21, 2024
1 parent bf42ea9 commit d14d651
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,29 @@ await SchemaBuilder.AlterIndexTableAsync<NotificationIndex>(table => table
collection: NotificationConstants.NotificationCollection
);

return 1;
await SchemaBuilder.AlterIndexTableAsync<NotificationIndex>(table => table
.CreateIndex("IDX_NotificationIndex_UserId",
"DocumentId",
"UserId",
"IsRead",
"CreatedAtUtc"),
collection: NotificationConstants.NotificationCollection
);

return 2;
}

public async Task<int> UpdateFrom1Async()
{
await SchemaBuilder.AlterIndexTableAsync<NotificationIndex>(table => table
.CreateIndex("IDX_NotificationIndex_UserId",
"DocumentId",
"UserId",
"IsRead",
"CreatedAtUtc"),
collection: NotificationConstants.NotificationCollection
);

return 2;
}
}

0 comments on commit d14d651

Please sign in to comment.