From 26d4d7d3378ae811fb9a766f3adc878899765e15 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 23 Jan 2026 19:51:24 +0100 Subject: [PATCH] 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. --- .../Postgres/20260120200503_BanRefactor.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Content.Server.Database/Migrations/Postgres/20260120200503_BanRefactor.cs b/Content.Server.Database/Migrations/Postgres/20260120200503_BanRefactor.cs index 64a20c2933e..6e6a9dfbe51 100644 --- a/Content.Server.Database/Migrations/Postgres/20260120200503_BanRefactor.cs +++ b/Content.Server.Database/Migrations/Postgres/20260120200503_BanRefactor.cs @@ -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");