From 689ba45533fc52dee02a6b7dd695d12b09b3f792 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 5 Jul 2026 20:16:45 +0200 Subject: [PATCH] Fix index drop order in AddTradeContextAndSubcategory migration to satisfy MySQL FK constraints --- ...0705165602_AddTradeContextAndSubcategory.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Predictalytics.Infrastructure/Migrations/20260705165602_AddTradeContextAndSubcategory.cs b/src/Predictalytics.Infrastructure/Migrations/20260705165602_AddTradeContextAndSubcategory.cs index 105adf3..14d6d93 100644 --- a/src/Predictalytics.Infrastructure/Migrations/20260705165602_AddTradeContextAndSubcategory.cs +++ b/src/Predictalytics.Infrastructure/Migrations/20260705165602_AddTradeContextAndSubcategory.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; @@ -12,10 +12,6 @@ namespace Predictalytics.Infrastructure.Migrations /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.DropIndex( - name: "IX_TraderCategoryPerformances_TraderId_Category", - table: "TraderCategoryPerformances"); - migrationBuilder.AddColumn( name: "LastAnalyzedAt", table: "Traders", @@ -62,6 +58,10 @@ namespace Predictalytics.Infrastructure.Migrations columns: new[] { "TraderId", "Category", "Subcategory" }, unique: true); + migrationBuilder.DropIndex( + name: "IX_TraderCategoryPerformances_TraderId_Category", + table: "TraderCategoryPerformances"); + migrationBuilder.CreateIndex( name: "IX_TradeContexts_TradeId", table: "TradeContexts", @@ -75,10 +75,6 @@ namespace Predictalytics.Infrastructure.Migrations migrationBuilder.DropTable( name: "TradeContexts"); - migrationBuilder.DropIndex( - name: "IX_TraderCategoryPerformances_TraderId_Category_Subcategory", - table: "TraderCategoryPerformances"); - migrationBuilder.DropColumn( name: "LastAnalyzedAt", table: "Traders"); @@ -92,6 +88,10 @@ namespace Predictalytics.Infrastructure.Migrations table: "TraderCategoryPerformances", columns: new[] { "TraderId", "Category" }, unique: true); + + migrationBuilder.DropIndex( + name: "IX_TraderCategoryPerformances_TraderId_Category_Subcategory", + table: "TraderCategoryPerformances"); } } }