Fix index drop order in AddTradeContextAndSubcategory migration to satisfy MySQL FK constraints
This commit is contained in:
+9
-9
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
@@ -12,10 +12,6 @@ namespace Predictalytics.Infrastructure.Migrations
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_TraderCategoryPerformances_TraderId_Category",
|
||||
table: "TraderCategoryPerformances");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user