Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMI-244 Fixed migration issue #2377

Merged
merged 3 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

This file was deleted.

11 changes: 0 additions & 11 deletions libs/net/dal/Migrations/1.3.15/Up/PostUp/00-CbraCreateIndex.sql

This file was deleted.

8 changes: 7 additions & 1 deletion 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.

16 changes: 16 additions & 0 deletions libs/net/dal/Migrations/20250101003614_1.3.15.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,31 @@ public partial class _1315 : SeedMigration
protected override void Up(MigrationBuilder migrationBuilder)
{
PreUp(migrationBuilder);
migrationBuilder.CreateIndex(
name: "IX_content_published_on",
table: "content",
column: "published_on",
descending: new bool[0]);

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

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
PreDown(migrationBuilder);
migrationBuilder.DropIndex(
name: "IX_content_published_on",
table: "content");

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

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

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

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

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

b.HasIndex(new[] { "Edition", "Section", "Byline" }, "IX_print_content");
Expand Down
Loading