[CLAUDE] Infra: Mig 43 filter Holiday UNIQUE (Year,Date) by IsDeleted (S45)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m19s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m19s
Fix drift surfaced by S45 Holiday coverage tests: DB UNIQUE (Year,Date) was unfiltered while handler checks !IsDeleted -> recreating a holiday on a soft-deleted slot threw DbUpdateException(500). Add .HasFilter("[IsDeleted] = 0") matching the 13x project filtered-unique pattern (Catalogs/Contract/PE/Proposal/Budget/WorkflowApps). Soft-deleted slot now reusable per app intent. Flipped Case 7 to assert success-on-reuse. 181 test PASS.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FilterHolidayUniqueIndexByIsDeleted : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Holidays_Year_Date",
|
||||
table: "Holidays");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Holidays_Year_Date",
|
||||
table: "Holidays",
|
||||
columns: new[] { "Year", "Date" },
|
||||
unique: true,
|
||||
filter: "[IsDeleted] = 0");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Holidays_Year_Date",
|
||||
table: "Holidays");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Holidays_Year_Date",
|
||||
table: "Holidays",
|
||||
columns: new[] { "Year", "Date" },
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2548,7 +2548,8 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Year", "Date")
|
||||
.IsUnique();
|
||||
.IsUnique()
|
||||
.HasFilter("[IsDeleted] = 0");
|
||||
|
||||
b.ToTable("Holidays", (string)null);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user