feat: 重构数据库迁移架构,支持多数据库提供程序 (SQLite/SQLServer/PostgreSQL/MySQL)

- 将迁移文件按数据库类型分目录存放 (Migrations/SQLite, MySQL, PostgreSQL, SqlServer)
- 新增各数据库提供程序的 DesignTimeDbContextFactory,支持 --provider 参数切换
- 新增 ProviderAppDataContexts,定义各数据库对应的 AppDataContext 子类
- DatabaseExtensions 增加 AddProviderAppDataContext 方法,按配置自动注册对应 DbContext
- 修正 MySQL 提供程序调用方式 (UseMySql -> UseMySQL)
- UserEntity 模型增加新字段
- 更新 add-migration.ps1
This commit is contained in:
2026-05-20 16:40:57 +08:00
parent fc6f9f6bc3
commit 1ab9a90831
36 changed files with 2503 additions and 67 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.7" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />