Stable to master (#42611)

Fix PostgreSQL migration for ban DB refactor (#42609)

This didn't come up in testing. The ban hit foreign key was added before the data was migrated, so it didn't work.

Fix that.
This commit is contained in:
Pieter-Jan Briers
2026-01-23 19:53:52 +01:00
committed by GitHub

View File

@@ -240,14 +240,6 @@ namespace Content.Server.Database.Migrations.Postgres
column: "ban_id",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_server_ban_hit_ban_ban_id",
table: "server_ban_hit",
column: "ban_id",
principalTable: "ban",
principalColumn: "ban_id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.Sql("""
CREATE INDEX "IX_ban_address_address"
ON ban_address
@@ -490,6 +482,14 @@ namespace Content.Server.Database.Migrations.Postgres
AND round_id IS NOT NULL;
""");
migrationBuilder.AddForeignKey(
name: "FK_server_ban_hit_ban_ban_id",
table: "server_ban_hit",
column: "ban_id",
principalTable: "ban",
principalColumn: "ban_id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.DropForeignKey(
name: "FK_server_ban_hit_server_ban_ban_id",
table: "server_ban_hit");