You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.7 KiB
43 lines
1.7 KiB
using LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore;
|
|
using LINGYUN.Abp.Saas.EntityFrameworkCore;
|
|
using LINGYUN.Abp.TextTemplating.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Volo.Abp.Data;
|
|
using Volo.Abp.EntityFrameworkCore;
|
|
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
|
|
using Volo.Abp.PermissionManagement;
|
|
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
|
|
using Volo.Abp.SettingManagement.EntityFrameworkCore;
|
|
|
|
namespace LY.MicroService.BackendAdmin.EntityFrameworkCore;
|
|
|
|
[ConnectionStringName("BackendAdminDbMigrator")]
|
|
public class BackendAdminMigrationsDbContext : AbpDbContext<BackendAdminMigrationsDbContext>
|
|
{
|
|
public BackendAdminMigrationsDbContext(DbContextOptions<BackendAdminMigrationsDbContext> options)
|
|
: base(options)
|
|
{
|
|
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
modelBuilder.ConfigureSaas();
|
|
modelBuilder.ConfigureTextTemplating();
|
|
modelBuilder.ConfigureFeatureManagement();
|
|
modelBuilder.ConfigureSettingManagement();
|
|
modelBuilder.ConfigurePermissionManagement();
|
|
modelBuilder.ConfigureDataProtectionManagement();
|
|
|
|
modelBuilder.Entity<ResourcePermissionGrant>(b =>
|
|
{
|
|
var maxResourceNameLength = modelBuilder.IsUsingMySQL() ? 128 : PermissionGrantConsts.MaxResourceNameLength;
|
|
var maxResourceKeyLength = modelBuilder.IsUsingMySQL() ? 128 : PermissionGrantConsts.MaxResourceKeyLength;
|
|
|
|
b.Property(x => x.ResourceName).HasMaxLength(maxResourceNameLength).IsRequired();
|
|
b.Property(x => x.ResourceKey).HasMaxLength(maxResourceKeyLength).IsRequired();
|
|
});
|
|
}
|
|
}
|
|
|