Browse Source
Merge pull request #12226 from abpframework/volo/issues/9728
Cli: Use `workingDirectory` for migration commands after module adding
pull/12233/head
liangshiwei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
3 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
|
|
|
@ -48,9 +48,10 @@ public class EfCoreMigrationManager : ITransientDependency |
|
|
|
? string.Empty |
|
|
|
: $"--context {dbContext}"; |
|
|
|
|
|
|
|
CmdHelper.RunCmd($"cd \"{dbMigrationsProjectFolder}\" && dotnet ef migrations add {migrationName}" + |
|
|
|
CmdHelper.RunCmd($"dotnet ef migrations add {migrationName}" + |
|
|
|
$" --output-dir {outputDirectory}" + |
|
|
|
$" {dbContextOption}"); |
|
|
|
$" {dbContextOption}", |
|
|
|
workingDirectory: dbMigrationsProjectFolder); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual string ParseModuleName(string fullModuleName) |
|
|
|
|
|
|
|
@ -679,7 +679,7 @@ public class SolutionModuleAdder : ITransientDependency |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(dbMigratorProject)) |
|
|
|
{ |
|
|
|
CmdHelper.RunCmd("cd \"" + Path.GetDirectoryName(dbMigratorProject) + "\" && dotnet run", out int exitCode); |
|
|
|
CmdHelper.RunCmd($"dotnet run", out int exitCode, workingDirectory: Path.GetDirectoryName(dbMigratorProject)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|