Skip to content

Commit

Permalink
Remove RoundEndText indexing
Browse files Browse the repository at this point in the history
Caused indexing issues when the text was too long lmao, this made the server try to redownload the errored file. This caused me to use 2TB of download in 1.5 days. Yipee!
  • Loading branch information
Simyon264 committed Apr 2, 2024
1 parent 04d6ada commit 7dd5c8a
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Server/Api/ReplayDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasIndex(r => r.Gamemode);
modelBuilder.Entity<Replay>()
.HasIndex(r => r.ServerId);
modelBuilder.Entity<Replay>()
.HasIndex(r => r.RoundEndText);
modelBuilder.Entity<Replay>();
modelBuilder.Entity<Replay>()
.HasIndex(r => r.ServerName);
modelBuilder.Entity<Player>()
Expand Down
169 changes: 169 additions & 0 deletions Server/Migrations/20240402222948_RemoveRoundEndTextIndex.Designer.cs

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

27 changes: 27 additions & 0 deletions Server/Migrations/20240402222948_RemoveRoundEndTextIndex.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Server.Migrations
{
/// <inheritdoc />
public partial class RemoveRoundEndTextIndex : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Replays_RoundEndText",
table: "Replays");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_Replays_RoundEndText",
table: "Replays",
column: "RoundEndText");
}
}
}
2 changes: 0 additions & 2 deletions Server/Migrations/ReplayDbContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("Map");

b.HasIndex("RoundEndText");

b.HasIndex("ServerId");

b.HasIndex("ServerName");
Expand Down

0 comments on commit 7dd5c8a

Please sign in to comment.