using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FinlyticAnalyzer.Migrations { /// public partial class CheckPendingAnalyzer : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_TradeProposals", table: "TradeProposals"); migrationBuilder.RenameTable( name: "TradeProposals", newName: "trade_proposals"); migrationBuilder.RenameIndex( name: "IX_TradeProposals_Isin", table: "trade_proposals", newName: "IX_trade_proposals_Isin"); migrationBuilder.RenameIndex( name: "IX_TradeProposals_ExpiresAt", table: "trade_proposals", newName: "IX_trade_proposals_ExpiresAt"); migrationBuilder.AlterColumn( name: "ProposedAction", table: "trade_proposals", type: "character varying(20)", maxLength: 20, nullable: false, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Name", table: "trade_proposals", type: "character varying(150)", maxLength: 150, nullable: false, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Isin", table: "trade_proposals", type: "character varying(30)", maxLength: 30, nullable: false, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AddColumn( name: "AnalysisId", table: "trade_proposals", type: "character varying(100)", maxLength: 100, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "EntryPrice", table: "trade_proposals", type: "numeric(18,4)", nullable: false, defaultValue: 0m); migrationBuilder.AddColumn( name: "EntryZoneMax", table: "trade_proposals", type: "numeric(18,4)", nullable: true); migrationBuilder.AddColumn( name: "EntryZoneMin", table: "trade_proposals", type: "numeric(18,4)", nullable: true); migrationBuilder.AddColumn( name: "EventId", table: "trade_proposals", type: "character varying(100)", maxLength: 100, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "FundamentalRationale", table: "trade_proposals", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "InstrumentType", table: "trade_proposals", type: "character varying(30)", maxLength: 30, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "MaxLeverage", table: "trade_proposals", type: "numeric(18,4)", nullable: true); migrationBuilder.AddColumn( name: "RiskRewardRatio", table: "trade_proposals", type: "numeric(18,4)", nullable: true); migrationBuilder.AddColumn( name: "RiskTolerance", table: "trade_proposals", type: "character varying(30)", maxLength: 30, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "RiskWarning", table: "trade_proposals", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "Sector", table: "trade_proposals", type: "character varying(50)", maxLength: 50, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "StopLoss", table: "trade_proposals", type: "numeric(18,4)", nullable: false, defaultValue: 0m); migrationBuilder.AddColumn( name: "Symbol", table: "trade_proposals", type: "character varying(30)", maxLength: 30, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "TakeProfit", table: "trade_proposals", type: "numeric(18,4)", nullable: false, defaultValue: 0m); migrationBuilder.AddColumn( name: "TakeProfitTargets", table: "trade_proposals", type: "text", nullable: true); migrationBuilder.AddColumn( name: "TechnicalRationale", table: "trade_proposals", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "Timeframe", table: "trade_proposals", type: "character varying(20)", maxLength: 20, nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "VixRegime", table: "trade_proposals", type: "integer", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "VixValue", table: "trade_proposals", type: "numeric(18,4)", nullable: false, defaultValue: 0m); migrationBuilder.AddColumn( name: "WinRate", table: "trade_proposals", type: "double precision", nullable: false, defaultValue: 0.0); migrationBuilder.AddPrimaryKey( name: "PK_trade_proposals", table: "trade_proposals", column: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_trade_proposals", table: "trade_proposals"); migrationBuilder.DropColumn( name: "AnalysisId", table: "trade_proposals"); migrationBuilder.DropColumn( name: "EntryPrice", table: "trade_proposals"); migrationBuilder.DropColumn( name: "EntryZoneMax", table: "trade_proposals"); migrationBuilder.DropColumn( name: "EntryZoneMin", table: "trade_proposals"); migrationBuilder.DropColumn( name: "EventId", table: "trade_proposals"); migrationBuilder.DropColumn( name: "FundamentalRationale", table: "trade_proposals"); migrationBuilder.DropColumn( name: "InstrumentType", table: "trade_proposals"); migrationBuilder.DropColumn( name: "MaxLeverage", table: "trade_proposals"); migrationBuilder.DropColumn( name: "RiskRewardRatio", table: "trade_proposals"); migrationBuilder.DropColumn( name: "RiskTolerance", table: "trade_proposals"); migrationBuilder.DropColumn( name: "RiskWarning", table: "trade_proposals"); migrationBuilder.DropColumn( name: "Sector", table: "trade_proposals"); migrationBuilder.DropColumn( name: "StopLoss", table: "trade_proposals"); migrationBuilder.DropColumn( name: "Symbol", table: "trade_proposals"); migrationBuilder.DropColumn( name: "TakeProfit", table: "trade_proposals"); migrationBuilder.DropColumn( name: "TakeProfitTargets", table: "trade_proposals"); migrationBuilder.DropColumn( name: "TechnicalRationale", table: "trade_proposals"); migrationBuilder.DropColumn( name: "Timeframe", table: "trade_proposals"); migrationBuilder.DropColumn( name: "VixRegime", table: "trade_proposals"); migrationBuilder.DropColumn( name: "VixValue", table: "trade_proposals"); migrationBuilder.DropColumn( name: "WinRate", table: "trade_proposals"); migrationBuilder.RenameTable( name: "trade_proposals", newName: "TradeProposals"); migrationBuilder.RenameIndex( name: "IX_trade_proposals_Isin", table: "TradeProposals", newName: "IX_TradeProposals_Isin"); migrationBuilder.RenameIndex( name: "IX_trade_proposals_ExpiresAt", table: "TradeProposals", newName: "IX_TradeProposals_ExpiresAt"); migrationBuilder.AlterColumn( name: "ProposedAction", table: "TradeProposals", type: "text", nullable: false, oldClrType: typeof(string), oldType: "character varying(20)", oldMaxLength: 20); migrationBuilder.AlterColumn( name: "Name", table: "TradeProposals", type: "text", nullable: false, oldClrType: typeof(string), oldType: "character varying(150)", oldMaxLength: 150); migrationBuilder.AlterColumn( name: "Isin", table: "TradeProposals", type: "text", nullable: false, oldClrType: typeof(string), oldType: "character varying(30)", oldMaxLength: 30); migrationBuilder.AddPrimaryKey( name: "PK_TradeProposals", table: "TradeProposals", column: "Id"); } } }