основное сделано
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Tnsu.ApprovalRoute.Domain.Entities;
|
||||
using Tnsu.ApprovalRoute.Infrastructure.Persistence.Entities;
|
||||
|
||||
namespace Tnsu.ApprovalRoute.Infrastructure.Persistence;
|
||||
|
||||
@@ -8,9 +9,20 @@ public class ApprovalRouteDbContext(DbContextOptions<ApprovalRouteDbContext> opt
|
||||
public DbSet<RequestType> RequestTypes => Set<RequestType>();
|
||||
public DbSet<TemplateRoute> TemplateRoutes => Set<TemplateRoute>();
|
||||
public DbSet<TemplateRouteStep> TemplateRouteSteps => Set<TemplateRouteStep>();
|
||||
public DbSet<AppSetting> Settings => Set<AppSetting>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<AppSetting>(e =>
|
||||
{
|
||||
// Имя таблицы задано явно: соглашение по именам сделало бы из
|
||||
// AppSetting «app_settings», а таблица должна называться так же, как
|
||||
// в api-tnsu-portal, — settings.
|
||||
e.ToTable("settings");
|
||||
e.HasKey(x => x.OptionName);
|
||||
e.Property(x => x.OptionName).HasMaxLength(128);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RequestType>(e =>
|
||||
{
|
||||
e.HasKey(x => x.Id);
|
||||
|
||||
Reference in New Issue
Block a user