93 lines
4.0 KiB
C#
93 lines
4.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace FinlyticAnalyzer.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Init : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "analyses",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
AnalysisId = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
|
EventId = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
|
Sector = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
|
|
Symbol = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
|
|
Isin = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
|
|
VixRegime = table.Column<int>(type: "integer", nullable: false),
|
|
VixValue = table.Column<decimal>(type: "numeric", nullable: false),
|
|
ImpactScore = table.Column<double>(type: "double precision", nullable: false),
|
|
WinRate = table.Column<double>(type: "double precision", nullable: false),
|
|
RawDataJson = table.Column<string>(type: "jsonb", nullable: false),
|
|
AiOutputJson = table.Column<string>(type: "jsonb", nullable: false),
|
|
N8nResponseJson = table.Column<string>(type: "jsonb", nullable: false),
|
|
N8nEvalScore = table.Column<double>(type: "double precision", nullable: false),
|
|
N8nDecision = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
|
|
IsTradeProposed = table.Column<bool>(type: "boolean", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(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<Guid>(type: "uuid", nullable: false),
|
|
ScanCronSchedule = table.Column<string>(type: "text", nullable: false),
|
|
MinSignalScore = table.Column<double>(type: "double precision", nullable: false),
|
|
UpdatedAt = table.Column<DateTime>(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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "analyses");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Settings");
|
|
}
|
|
}
|
|
}
|