using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FinlyticAnalyzer.Migrations { /// public partial class Init : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "analyses", columns: table => new { Id = table.Column(type: "uuid", nullable: false), AnalysisId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), EventId = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), Sector = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), Symbol = table.Column(type: "character varying(30)", maxLength: 30, nullable: false), Isin = table.Column(type: "character varying(30)", maxLength: 30, nullable: false), VixRegime = table.Column(type: "integer", nullable: false), VixValue = table.Column(type: "numeric", nullable: false), ImpactScore = table.Column(type: "double precision", nullable: false), WinRate = table.Column(type: "double precision", nullable: false), RawDataJson = table.Column(type: "jsonb", nullable: false), AiOutputJson = table.Column(type: "jsonb", nullable: false), N8nResponseJson = table.Column(type: "jsonb", nullable: false), N8nEvalScore = table.Column(type: "double precision", nullable: false), N8nDecision = table.Column(type: "character varying(30)", maxLength: 30, nullable: false), IsTradeProposed = table.Column(type: "boolean", nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_analyses", x => x.Id); }); migrationBuilder.CreateTable( name: "Settings", columns: table => new { Id = table.Column(type: "uuid", nullable: false), ScanCronSchedule = table.Column(type: "text", nullable: false), MinSignalScore = table.Column(type: "double precision", nullable: false), UpdatedAt = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Settings", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_analyses_AnalysisId", table: "analyses", column: "AnalysisId", unique: true); migrationBuilder.CreateIndex( name: "IX_analyses_CreatedAt", table: "analyses", column: "CreatedAt"); migrationBuilder.CreateIndex( name: "IX_analyses_EventId", table: "analyses", column: "EventId"); migrationBuilder.CreateIndex( name: "IX_analyses_Isin", table: "analyses", column: "Isin"); migrationBuilder.CreateIndex( name: "IX_analyses_Sector", table: "analyses", column: "Sector"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "analyses"); migrationBuilder.DropTable( name: "Settings"); } } }