using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Edge.Core.Database.Migrations { public partial class AddGenericAlarms : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "GenericAlarms", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), ProcessorEndpointFullTypeStr = table.Column(type: "TEXT", nullable: true), OriginatorDisplayName = table.Column(type: "TEXT", nullable: true), Title = table.Column(type: "TEXT", nullable: true), Detail = table.Column(type: "TEXT", nullable: true), Category = table.Column(type: "TEXT", nullable: true), SubCategory = table.Column(type: "TEXT", nullable: true), HiddenData = table.Column(type: "TEXT", nullable: true), Action = table.Column(type: "TEXT", nullable: true), Severity = table.Column(type: "INTEGER", nullable: false), OpeningTimestamp = table.Column(type: "TEXT", nullable: false), AckedReason = table.Column(type: "TEXT", nullable: true), AckedTimestamp = table.Column(type: "TEXT", nullable: true), ClosedReason = table.Column(type: "TEXT", nullable: true), ClosedTimestamp = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_GenericAlarms", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_GenericAlarms_Category_SubCategory", table: "GenericAlarms", columns: new[] { "Category", "SubCategory" }); migrationBuilder.CreateIndex( name: "IX_GenericAlarms_ClosedTimestamp", table: "GenericAlarms", column: "ClosedTimestamp"); migrationBuilder.CreateIndex( name: "IX_GenericAlarms_HiddenData", table: "GenericAlarms", column: "HiddenData"); migrationBuilder.CreateIndex( name: "IX_GenericAlarms_OpeningTimestamp", table: "GenericAlarms", column: "OpeningTimestamp"); migrationBuilder.CreateIndex( name: "IX_GenericAlarms_OriginatorDisplayName_OpeningTimestamp_ClosedTimestamp", table: "GenericAlarms", columns: new[] { "OriginatorDisplayName", "OpeningTimestamp", "ClosedTimestamp" }); migrationBuilder.CreateIndex( name: "IX_GenericAlarms_ProcessorEndpointFullTypeStr", table: "GenericAlarms", column: "ProcessorEndpointFullTypeStr"); migrationBuilder.CreateIndex( name: "IX_GenericAlarms_Severity", table: "GenericAlarms", column: "Severity"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "GenericAlarms"); } } }