mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 19:00:07 +01:00
feat: add db model for statistics
This commit is contained in:
@@ -18,6 +18,7 @@ namespace QuotifyBE.Data
|
||||
public DbSet<Category> Categories => Set<Category>();
|
||||
public DbSet<Image> Images => Set<Image>();
|
||||
public DbSet<QuoteCategory> QuoteCategories => Set<QuoteCategory>();
|
||||
public DbSet<Statistic> Statistics => Set<Statistic>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
@@ -25,6 +26,10 @@ namespace QuotifyBE.Data
|
||||
|
||||
builder.Entity<QuoteCategory>()
|
||||
.HasKey(vs => new { vs.QuoteId, vs.CategoryId });
|
||||
|
||||
builder.Entity<Statistic>(e => {
|
||||
e.HasIndex(e => e.Label).IsUnique();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user