revamp
This commit is contained in:
@@ -16,6 +16,7 @@ public sealed class AppDbContext : DbContext
|
||||
public DbSet<AuthorizationGroupEntity> AuthorizationGroups => Set<AuthorizationGroupEntity>();
|
||||
public DbSet<PermissionRuleEntity> PermissionRules => Set<PermissionRuleEntity>();
|
||||
public DbSet<AuditRecordEntity> AuditRecords => Set<AuditRecordEntity>();
|
||||
public DbSet<ManagedPageEntity> ManagedPages => Set<ManagedPageEntity>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -87,5 +88,19 @@ public sealed class AppDbContext : DbContext
|
||||
e.Property(x => x.Target).HasMaxLength(200).IsRequired();
|
||||
e.HasIndex(x => x.TimestampUtc);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ManagedPageEntity>(e =>
|
||||
{
|
||||
e.ToTable("ManagedPage");
|
||||
e.HasKey(x => x.Id);
|
||||
e.Property(x => x.Key).HasMaxLength(100).IsRequired();
|
||||
e.Property(x => x.DisplayName).HasMaxLength(200).IsRequired();
|
||||
e.Property(x => x.PageKind).HasMaxLength(50).IsRequired();
|
||||
e.Property(x => x.RecurrenceRule).HasMaxLength(200);
|
||||
e.Property(x => x.LastUpdatedBy).HasMaxLength(200).IsRequired();
|
||||
e.Property(x => x.ContentJson).IsRequired();
|
||||
e.HasIndex(x => x.Key).IsUnique();
|
||||
e.HasIndex(x => new { x.PageKind, x.IsEnabled, x.Priority });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user