Wei.Abp.DatabaseMigrationManagement 5.0.0-beta.3

This is a prerelease version of Wei.Abp.DatabaseMigrationManagement.
dotnet add package Wei.Abp.DatabaseMigrationManagement --version 5.0.0-beta.3
                    
NuGet\Install-Package Wei.Abp.DatabaseMigrationManagement -Version 5.0.0-beta.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wei.Abp.DatabaseMigrationManagement" Version="5.0.0-beta.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wei.Abp.DatabaseMigrationManagement" Version="5.0.0-beta.3" />
                    
Directory.Packages.props
<PackageReference Include="Wei.Abp.DatabaseMigrationManagement" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Wei.Abp.DatabaseMigrationManagement --version 5.0.0-beta.3
                    
#r "nuget: Wei.Abp.DatabaseMigrationManagement, 5.0.0-beta.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Wei.Abp.DatabaseMigrationManagement@5.0.0-beta.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Wei.Abp.DatabaseMigrationManagement&version=5.0.0-beta.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Wei.Abp.DatabaseMigrationManagement&version=5.0.0-beta.3&prerelease
                    
Install as a Cake Tool

Wei.Abp.DatabaseMigrationManagement

用于 ABP 聚合应用和业务服务的 Host 级 EF Core Migration 管理模块。模块只提供迁移目录、准备确认与执行能力,不在应用启动时自动迁移,也不隐式执行数据种子。

目标模型

  • 部署应用:实际发布和启动的 Host,例如 auth-service-backend。
  • 逻辑服务:聚合 Host 内部的 SaaS、YARP、Administration、Identity 等服务。
  • 数据库目标:一个带独立 Migration 历史表的 EF Core DbContext。

注册

Configure<DatabaseMigrationManagementOptions>(options =>
{
    options.ApplicationName = "auth-service-backend";
    options.ApplicationDisplayName = "Auth 聚合基础服务应用";
    options.AddDatabase<IdentityServiceDbContext>(
        "identity",
        "身份认证数据库",
        IdentityServiceDbProperties.ConnectionStringName,
        DatabaseMigrationTargetScope.HostAndTenant,
        allowRollback: true,
        logicalServiceName: "identity-service",
        logicalServiceDisplayName: "身份认证服务",
        executionOrder: 400);
});

聚合应用按 ExecutionOrder 正序升级、倒序回退。

SaaS 连接解析

租户目标遵循 ABP 9 的连接解析顺序:DbContext 专用连接、映射数据库连接、租户 Default。如果均未配置,实际会回退到 Host 共享库,因此模块拒绝在租户范围执行,要求改用 Host 范围迁移。

API 不返回原始连接字符串;目录只返回数据库服务地址、数据库名和连接来源。租户连接维护接口应只回显脱敏值。

安全边界

  • 仅 Host 用户可用。
  • 查看、升级、回退使用独立权限。
  • 执行前生成短期确认令牌,并绑定应用、用户、数据库、租户、当前版本和目标版本。
  • 使用分布式锁防止同一目标并发迁移。
  • 数据库当前版本变化后,旧确认自动失效。
  • 当前应用包无法识别数据库中的已应用 Migration 时禁止执行。
  • 回退会运行 EF Migration Down,生产环境必须先完成可恢复备份。
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0-beta.3 49 9/17/2026
5.0.0-beta.2 44 9/16/2026