using Data.SeaHavenIndustries; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// [DbContext(typeof(ApplicationDbContext))] [Migration("20260713120000_Phase7_ExternalWorkOrderIdUnique")] public partial class Phase7_ExternalWorkOrderIdUnique : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "ExternalWorkOrderId", table: "workOrders", type: "nvarchar(450)", maxLength: 450, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.CreateIndex( name: "IX_workOrders_ExternalWorkOrderId", table: "workOrders", column: "ExternalWorkOrderId", unique: true, filter: "[ExternalWorkOrderId] IS NOT NULL AND [ExternalWorkOrderId] <> ''"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropIndex( name: "IX_workOrders_ExternalWorkOrderId", table: "workOrders"); migrationBuilder.AlterColumn( name: "ExternalWorkOrderId", table: "workOrders", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(450)", oldMaxLength: 450, oldNullable: true); } } }