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.
|
|
1 year ago | |
|---|---|---|
| .. | ||
| Migrations | 2 years ago | |
| AuthServerDbMigrationEventHandler.cs | 2 years ago | |
| AuthServerDbMigrationService.cs | 2 years ago | |
| AuthServerMigrationsDbContext.cs | 3 years ago | |
| AuthServerMigrationsDbContextFactory.cs | 3 years ago | |
| AuthServerMigrationsEntityFrameworkCoreModule.cs | 2 years ago | |
| FodyWeavers.xml | 3 years ago | |
| FodyWeavers.xsd | 3 years ago | |
| LY.MicroService.AuthServer.EntityFrameworkCore.csproj | 2 years ago | |
| README.EN.md | 1 year ago | |
| README.md | 1 year ago | |
README.md
LY.MicroService.AuthServer.EntityFrameworkCore
认证服务器数据库迁移模块,提供认证服务器所需的数据库迁移功能。
功能特性
- 集成OpenIddict认证框架的数据库迁移
- 集成ABP Identity模块的数据库迁移
- 集成ABP权限管理模块的数据库迁移
- 集成ABP设置管理模块的数据库迁移
- 集成ABP特性管理模块的数据库迁移
- 集成ABP SaaS多租户模块的数据库迁移
- 集成文本模板模块的数据库迁移
- 支持MySQL数据库
模块引用
[DependsOn(
typeof(AbpAuthorizationModule),
typeof(AbpSaasEntityFrameworkCoreModule),
typeof(AbpOpenIddictEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpTextTemplatingEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule)
)]
public class YourModule : AbpModule
{
// other
}
配置项
{
"ConnectionStrings": {
"AuthServerDbMigrator": "你的数据库连接字符串"
}
}
基本用法
-
配置数据库连接字符串
- 在appsettings.json中配置AuthServerDbMigrator连接字符串
-
添加数据库上下文
public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAbpDbContext<AuthServerMigrationsDbContext>(); Configure<AbpDbContextOptions>(options => { options.UseMySQL(); }); } -
执行数据库迁移
- 使用EF Core命令行工具执行迁移
dotnet ef database update
注意事项
- 确保数据库连接字符串中包含正确的权限,以便能够创建和修改数据库表
- 在执行迁移之前,建议先备份数据库
- 迁移脚本会自动处理模块间的依赖关系