using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class SH133_WorkOrderWebhookIngestion : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ExternalLastOccurredAt", table: "workOrders", type: "datetimeoffset", nullable: true); migrationBuilder.CreateTable( name: "WorkOrderWebhookDeliveries", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), DeliveryId = table.Column( type: "nvarchar(128)", maxLength: 128, nullable: false), EventType = table.Column( type: "nvarchar(64)", maxLength: 64, nullable: false), OccurredAt = table.Column( type: "datetimeoffset", nullable: false), ProcessedAt = table.Column( type: "datetimeoffset", nullable: false), BodySha256 = table.Column( type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_WorkOrderWebhookDeliveries", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_WorkOrderWebhookDeliveries_DeliveryId", table: "WorkOrderWebhookDeliveries", column: "DeliveryId", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WorkOrderWebhookDeliveries"); migrationBuilder.DropColumn( name: "ExternalLastOccurredAt", table: "workOrders"); } } }