Skip to content

Commit

Permalink
MMI-244 Updated indexes
Browse files Browse the repository at this point in the history
- changed the indexes to be (published on and status),
and (published on)
  • Loading branch information
laidaoyu committed Jan 2, 2025
1 parent 3e4aa71 commit 041c486
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
6 changes: 4 additions & 2 deletions libs/net/dal/Configuration/ContentConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public override void Configure(EntityTypeBuilder<Content> builder)
builder.HasIndex(m => new { m.ContentType, m.OtherSource, m.Uid, m.Page, m.Status, m.IsHidden }, "IX_content");
builder.HasIndex(m => new { m.Edition, m.Section, m.Byline }, "IX_print_content");
builder.HasIndex(m => m.Headline, "IX_headline");
builder.HasIndex(m => m.PublishedOn, "IX_content_published_on");
builder.HasIndex(m => m.Status, "IX_content_status");
builder.HasIndex(m => new { m.PublishedOn, m.Status }, "IX_content_published_on_status")
.IsDescending(true, false);
builder.HasIndex(m => m.PublishedOn, "IX_content_published_on")
.IsDescending(true);

base.Configure(builder);
}
Expand Down
8 changes: 5 additions & 3 deletions libs/net/dal/Migrations/20250101003614_1.3.15.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions libs/net/dal/Migrations/20250101003614_1.3.15.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ protected override void Up(MigrationBuilder migrationBuilder)
migrationBuilder.CreateIndex(
name: "IX_content_published_on",
table: "content",
column: "published_on",null,false,null,[true]);
column: "published_on",
descending: new bool[0]);

migrationBuilder.CreateIndex(
name: "IX_content_status",
name: "IX_content_published_on_status",
table: "content",
column: "status");
columns: new[] { "published_on", "status" },
descending: new[] { true, false });
PostUp(migrationBuilder);
}

Expand All @@ -33,7 +35,7 @@ protected override void Down(MigrationBuilder migrationBuilder)
table: "content");

migrationBuilder.DropIndex(
name: "IX_content_status",
name: "IX_content_published_on_status",
table: "content");
PostDown(migrationBuilder);
}
Expand Down
6 changes: 4 additions & 2 deletions libs/net/dal/Migrations/TNOContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,9 +1105,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex(new[] { "PublishedOn", "CreatedOn" }, "IX_content_dates");

b.HasIndex(new[] { "PublishedOn" }, "IX_content_published_on");
b.HasIndex(new[] { "PublishedOn" }, "IX_content_published_on")
.IsDescending();

b.HasIndex(new[] { "Status" }, "IX_content_status");
b.HasIndex(new[] { "PublishedOn", "Status" }, "IX_content_published_on_status")
.IsDescending(true, false);

b.HasIndex(new[] { "Headline" }, "IX_headline");

Expand Down

0 comments on commit 041c486

Please sign in to comment.