This commit is contained in:
2025-02-07 15:44:59 -05:00
parent 2b30479263
commit 009368ca8f
38 changed files with 1815 additions and 945 deletions

View File

@@ -8,6 +8,7 @@ public class ContentDbContext(
public DbSet<Content> Contents => Set<Content>();
public DbSet<Creator> Creators => Set<Creator>();
public DbSet<Slugs> Slugs => Set<Slugs>();
protected override void OnModelCreating(
ModelBuilder modelBuilder)
@@ -36,12 +37,12 @@ public class ContentDbContext(
.Property(c => c.ThumbnailUrl);
modelBuilder
.Entity<Creator>()
.Entity<Slugs>()
.Property(x => x.NormalizedName)
.HasComputedColumnSql("LOWER( \"Content\".\"Creators\".\"Name\")", stored: true);
.HasComputedColumnSql("LOWER( \"Content\".\"Slugs\".\"Name\")", stored: true);
modelBuilder
.Entity<Creator>()
.Entity<Slugs>()
.HasIndex(x => x.NormalizedName)
.IsUnique();