This commit is contained in:
2026-05-17 20:54:09 -04:00
parent 6da2183583
commit 74c21ee5cc
3000 changed files with 11794 additions and 15301 deletions

View File

@@ -52,6 +52,11 @@ public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options
public DbSet<BlogPostTag> BlogPostTags { get; set; }
public DbSet<BlogPostViewCount> BlogPostViews { get; set; }
/// <summary>
/// Only allowed to have 1 row
/// </summary>
public DbSet<HomePageConfiguration> HomePageConfiguration { get; set; }
/// <summary>
/// Configuration for what featured artifacts will be show on the homepage of the search page
@@ -117,6 +122,11 @@ public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options
.WithOne(file => file.ParentBlogPost)
.HasForeignKey<FilePathListing>(file => file.ParentBlogPostId);
modelBuilder.Entity<HomePageConfiguration>()
.HasOne(config => config.HomePageBanner)
.WithOne(file => file.HomePageConfiguration)
.HasForeignKey<FilePathListing>(file => file.HomePageConfigurationId);
// Create the search vector columns for artifat groupings
modelBuilder.Entity<ArtifactGrouping>()
.HasGeneratedTsVectorColumn(