fix: CMS image proxy + partial unique index for soft-deleted releases

This commit is contained in:
daniel-c-harvey
2026-06-12 06:27:34 -04:00
parent dd30d57838
commit 0448711082
10 changed files with 310 additions and 52 deletions
@@ -59,9 +59,12 @@ public class ReleaseConfiguration : BaseEntityConfiguration<ReleaseEntity>
// Unique constraint on the natural key (title + artist). Prevents duplicate release rows
// from concurrent uploads of the same album. The FindOrCreateRelease path catches the
// resulting ClassifiedDbException (UniqueViolation) and re-queries for the winning row.
// resulting UniqueViolation and re-queries for the winning row.
// Partial filter excludes soft-deleted rows so re-uploading a deleted release does not
// hit a uniqueness conflict when FindOrCreateRelease creates a fresh row.
builder.HasIndex(e => new { e.Title, e.Artist })
.IsUnique()
.HasDatabaseName("IX_release_title_artist");
.HasDatabaseName("IX_release_title_artist")
.HasFilter("\"is_deleted\" = false");
}
}