Skip to content

Commit 5180a9a

Browse files
committed
Add Index
1 parent fdda106 commit 5180a9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/LinkDotNet.Blog.Infrastructure/Persistence/Sql/Mapping/BlogPostConfiguration.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ public void Configure(EntityTypeBuilder<BlogPost> builder)
2222
builder.Property(x => x.ShortDescription).IsRequired();
2323
builder.Property(x => x.Likes).IsRequired();
2424
builder.Property(x => x.IsPublished).IsRequired();
25+
26+
builder.HasIndex(x => new { x.IsPublished, x.UpdatedDate })
27+
.HasDatabaseName("IX_BlogPosts_IsPublished_UpdatedDate")
28+
.IsDescending(false, true);
2529
}
2630
}

0 commit comments

Comments
 (0)