5d6b54d2fc
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.
28 lines
924 B
C#
28 lines
924 B
C#
using DeepDrftModels.Entities;
|
|
using DeepDrftData.Data.Configurations;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace DeepDrftData.Data;
|
|
|
|
public class DeepDrftContext : DbContext
|
|
{
|
|
public DeepDrftContext(DbContextOptions<DeepDrftContext> options) : base(options)
|
|
{
|
|
}
|
|
|
|
public DbSet<TrackEntity> Tracks { get; set; }
|
|
public DbSet<ReleaseEntity> Releases { get; set; }
|
|
public DbSet<SessionMetadata> SessionMetadata { get; set; }
|
|
public DbSet<MixMetadata> MixMetadata { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
modelBuilder.ApplyConfiguration(new TrackConfiguration());
|
|
modelBuilder.ApplyConfiguration(new ReleaseConfiguration());
|
|
modelBuilder.ApplyConfiguration(new SessionMetadataConfiguration());
|
|
modelBuilder.ApplyConfiguration(new MixMetadataConfiguration());
|
|
}
|
|
}
|