Browse Source
Update framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/24685/head
Ma Liming
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
1 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs
|
|
|
@ -44,8 +44,13 @@ public class EfCoreMigrationManager : ITransientDependency |
|
|
|
string dbContext, |
|
|
|
string outputDirectory) |
|
|
|
{ |
|
|
|
CmdHelper.RunCmd($"dotnet build", workingDirectory: dbMigrationsProjectFolder); |
|
|
|
CmdHelper.RunCmd($"dotnet build", workingDirectory: dbMigrationsProjectFolder, exitCode: out var buildExitCode); |
|
|
|
|
|
|
|
if (buildExitCode != 0) |
|
|
|
{ |
|
|
|
Logger.LogWarning("Dotnet build failed for project folder {ProjectFolder}. Skipping EF Core migration command.", dbMigrationsProjectFolder); |
|
|
|
return; |
|
|
|
} |
|
|
|
var dbContextOption = string.IsNullOrWhiteSpace(dbContext) |
|
|
|
? string.Empty |
|
|
|
: $"--context {dbContext}"; |
|
|
|
|