fix: CMS image proxy + partial unique index for soft-deleted releases
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user