using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PolyTrader.Modules.CopyTrading.Persistence.Ef.Migrations
{
///
public partial class AddCopytradingBehaviorSettings : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "AutoPauseEnabled",
table: "mod_copytrading_traders",
type: "tinyint(1)",
nullable: false,
defaultValue: true);
migrationBuilder.AddColumn(
name: "MakerEntry",
table: "mod_copytrading_traders",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "MaxSpreadPct",
table: "mod_copytrading_account_settings",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
defaultValue: 5m);
migrationBuilder.AddColumn(
name: "MinSellRatioPct",
table: "mod_copytrading_account_settings",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
defaultValue: 10m);
migrationBuilder.AddColumn(
name: "SellFloorPct",
table: "mod_copytrading_account_settings",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
defaultValue: 15m);
// Entscheidung Richard: ProfitTarget zunächst überall auf 9999 (praktisch deaktiviert),
// bis die Take-Profit-Logik (Phase 0.3) scharf geschaltet wird.
migrationBuilder.Sql("UPDATE mod_copytrading_account_settings SET ProfitTarget = 9999;");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AutoPauseEnabled",
table: "mod_copytrading_traders");
migrationBuilder.DropColumn(
name: "MakerEntry",
table: "mod_copytrading_traders");
migrationBuilder.DropColumn(
name: "MaxSpreadPct",
table: "mod_copytrading_account_settings");
migrationBuilder.DropColumn(
name: "MinSellRatioPct",
table: "mod_copytrading_account_settings");
migrationBuilder.DropColumn(
name: "SellFloorPct",
table: "mod_copytrading_account_settings");
}
}
}