using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class Phase5_DomainEvents : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "WorkOrderWeekRolledLedgers", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), WorkOrderId = table.Column(type: "int", nullable: false), SourceWeekStart = table.Column(type: "date", nullable: false), ProcessedAt = table.Column(type: "datetime2", nullable: false), CorrelationId = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_WorkOrderWeekRolledLedgers", x => x.Id); table.ForeignKey( name: "FK_WorkOrderWeekRolledLedgers_workOrders_WorkOrderId", column: x => x.WorkOrderId, principalTable: "workOrders", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_WorkOrderWeekRolledLedgers_WorkOrderId_SourceWeekStart", table: "WorkOrderWeekRolledLedgers", columns: new[] { "WorkOrderId", "SourceWeekStart" }, unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WorkOrderWeekRolledLedgers"); } } }