feat(tracks): add ReleaseType and TrackNumber to track metadata model and CMS edit form

This commit is contained in:
daniel-c-harvey
2026-06-10 21:36:00 -04:00
parent f8186fb7c7
commit d47a5e00af
15 changed files with 292 additions and 6 deletions
@@ -1,5 +1,6 @@
using Data.Data.Configurations;
using DeepDrftModels.Entities;
using DeepDrftModels.Enums;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
@@ -57,6 +58,18 @@ public class TrackConfiguration : BaseEntityConfiguration<TrackEntity>
.HasMaxLength(500)
.HasColumnName("original_file_name");
builder.Property(e => e.ReleaseType)
.IsRequired()
.HasConversion<string>() // Store as readable string, not int ordinal
.HasMaxLength(20)
.HasColumnName("release_type")
.HasDefaultValue(ReleaseType.Single);
builder.Property(e => e.TrackNumber)
.IsRequired()
.HasColumnName("track_number")
.HasDefaultValue(1);
// Names the is_deleted index explicitly. BaseEntityConfiguration.Configure already
// calls HasIndex(e => e.IsDeleted); this adds HasDatabaseName so EF always uses
// "IX_track_is_deleted" regardless of auto-naming conventions.