init
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user