using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations { /// public partial class AddSiteCallsTable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "SiteCalls", columns: table => new { TrackedOperationId = table.Column(type: "varchar(36)", unicode: false, maxLength: 36, nullable: false), Channel = table.Column(type: "varchar(32)", unicode: false, maxLength: 32, nullable: false), Target = table.Column(type: "varchar(256)", unicode: false, maxLength: 256, nullable: false), SourceSite = table.Column(type: "varchar(64)", unicode: false, maxLength: 64, nullable: false), Status = table.Column(type: "varchar(32)", unicode: false, maxLength: 32, nullable: false), RetryCount = table.Column(type: "int", nullable: false), LastError = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), HttpStatus = table.Column(type: "int", nullable: true), CreatedAtUtc = table.Column(type: "datetime2", nullable: false), UpdatedAtUtc = table.Column(type: "datetime2", nullable: false), TerminalAtUtc = table.Column(type: "datetime2", nullable: true), IngestedAtUtc = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SiteCalls", x => x.TrackedOperationId); }); migrationBuilder.CreateIndex( name: "IX_SiteCalls_Source_Created", table: "SiteCalls", columns: new[] { "SourceSite", "CreatedAtUtc" }, descending: new[] { false, true }); migrationBuilder.CreateIndex( name: "IX_SiteCalls_Status_Updated", table: "SiteCalls", columns: new[] { "Status", "UpdatedAtUtc" }, descending: new[] { false, true }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SiteCalls"); } } }