using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CMSMicroservice.Infrastructure.Persistence.Migrations { /// public partial class AddWorkerExecutionLog : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "WorkerExecutionLogs", schema: "CMS", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ExecutionId = table.Column(type: "uniqueidentifier", nullable: false), WeekNumber = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), StartedAt = table.Column(type: "datetime2", nullable: false), CompletedAt = table.Column(type: "datetime2", nullable: true), DurationMs = table.Column(type: "bigint", nullable: true), Status = table.Column(type: "int", nullable: false), ProcessedCount = table.Column(type: "int", nullable: false), ErrorCount = table.Column(type: "int", nullable: false), ErrorMessage = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), ErrorStackTrace = table.Column(type: "nvarchar(max)", nullable: true), Details = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), LastModified = table.Column(type: "datetime2", nullable: true), LastModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_WorkerExecutionLogs", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_WorkerExecutionLogs_StartedAt", schema: "CMS", table: "WorkerExecutionLogs", column: "StartedAt"); migrationBuilder.CreateIndex( name: "IX_WorkerExecutionLogs_Status", schema: "CMS", table: "WorkerExecutionLogs", column: "Status"); migrationBuilder.CreateIndex( name: "IX_WorkerExecutionLogs_WeekNumber", schema: "CMS", table: "WorkerExecutionLogs", column: "WeekNumber"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WorkerExecutionLogs", schema: "CMS"); } } }