Phase 9 Wave 1: add ReleaseMedium discriminator + Session/Mix metadata
Add ReleaseMedium enum (Cut/Session/Mix) and two 1:1 satellite entities (SessionMetadata, MixMetadata) with EF configs and an additive migration. ReleaseDto.ReleaseType is now nullable, nulled for non-Cut at the converter. Existing releases default to Cut via column default; no data migration.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using Models.Entities;
|
||||
|
||||
namespace DeepDrftModels.Entities;
|
||||
|
||||
// 1:1 satellite for Mix-medium releases (Phase 9). One row per Mix ReleaseEntity, keyed by a unique
|
||||
// ReleaseId FK (the 1:1 enforcement lives in MixMetadataConfiguration). Carries the entry key for
|
||||
// the preprocessed high-resolution waveform datum.
|
||||
//
|
||||
// Inherits Id, CreatedAt, UpdatedAt, IsDeleted from BaseEntity (Cerebellum.BlazorBlocks.Models).
|
||||
// BaseEntity ships the audit columns but does not declare IEntity itself, so subclasses declare it
|
||||
// explicitly to satisfy the generic constraints on Repository<>/Manager<>/etc.
|
||||
public class MixMetadata : BaseEntity, IEntity
|
||||
{
|
||||
public long ReleaseId { get; set; }
|
||||
public ReleaseEntity Release { get; set; } = null!;
|
||||
public required string WaveformEntryKey { get; set; }
|
||||
}
|
||||
@@ -18,6 +18,13 @@ public class ReleaseEntity : BaseEntity, IEntity
|
||||
public DateOnly? ReleaseDate { get; set; }
|
||||
public string? ImagePath { get; set; }
|
||||
public ReleaseType ReleaseType { get; set; } = ReleaseType.Single;
|
||||
public ReleaseMedium Medium { get; set; } = ReleaseMedium.Cut;
|
||||
public long? CreatedByUserId { get; set; }
|
||||
public ICollection<TrackEntity> Tracks { get; set; } = new List<TrackEntity>();
|
||||
|
||||
// 1:1 satellites selected by Medium. Null unless this release is the matching medium —
|
||||
// Session releases carry SessionMetadata, Mix releases carry MixMetadata, Cut releases carry
|
||||
// neither (ReleaseType on this table is their discriminator data).
|
||||
public SessionMetadata? SessionMetadata { get; set; }
|
||||
public MixMetadata? MixMetadata { get; set; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Models.Entities;
|
||||
|
||||
namespace DeepDrftModels.Entities;
|
||||
|
||||
// 1:1 satellite for Session-medium releases (Phase 9). One row per Session ReleaseEntity, keyed by
|
||||
// a unique ReleaseId FK (the 1:1 enforcement lives in SessionMetadataConfiguration). Carries the
|
||||
// hero-image entry key into the Image vault.
|
||||
//
|
||||
// Inherits Id, CreatedAt, UpdatedAt, IsDeleted from BaseEntity (Cerebellum.BlazorBlocks.Models).
|
||||
// BaseEntity ships the audit columns but does not declare IEntity itself, so subclasses declare it
|
||||
// explicitly to satisfy the generic constraints on Repository<>/Manager<>/etc.
|
||||
public class SessionMetadata : BaseEntity, IEntity
|
||||
{
|
||||
public long ReleaseId { get; set; }
|
||||
public ReleaseEntity Release { get; set; } = null!;
|
||||
public required string HeroImageEntryKey { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user