Browse Source
Merge pull request #7271 from abpframework/revert-remove-delete-migrations-when-no-SqlServer
Cli: Remove `DeleteMigrationsIfNeeded` method since migrations are already removed
pull/7273/head
Alper Ebicoglu
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
0 additions and
41 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/EfCoreMigrationManager.cs
|
|
|
@ -226,8 +226,6 @@ namespace Volo.Abp.Cli.Commands |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
DeleteMigrationsIfNeeded(databaseProvider, databaseManagementSystem, outputFolder); |
|
|
|
|
|
|
|
Logger.LogInformation($"'{projectName}' has been successfully created to '{outputFolder}'"); |
|
|
|
|
|
|
|
|
|
|
|
@ -256,23 +254,6 @@ namespace Volo.Abp.Cli.Commands |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void DeleteMigrationsIfNeeded(DatabaseProvider databaseProvider, DatabaseManagementSystem databaseManagementSystem, string outputFolder) |
|
|
|
{ |
|
|
|
if (databaseManagementSystem == DatabaseManagementSystem.NotSpecified || databaseManagementSystem == DatabaseManagementSystem.SQLServer) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (databaseProvider != DatabaseProvider.NotSpecified && databaseProvider != DatabaseProvider.EntityFrameworkCore) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
Logger.LogInformation($"Deleting migrations..."); |
|
|
|
|
|
|
|
_efCoreMigrationManager.RemoveAllMigrations(outputFolder); |
|
|
|
} |
|
|
|
|
|
|
|
private void OpenThanksPage(UiFramework uiFramework, DatabaseProvider databaseProvider, bool tiered, bool commercial) |
|
|
|
{ |
|
|
|
uiFramework = uiFramework == UiFramework.NotSpecified || uiFramework == UiFramework.None ? UiFramework.Mvc : uiFramework; |
|
|
|
|
|
|
|
@ -27,28 +27,6 @@ namespace Volo.Abp.Cli.ProjectModification |
|
|
|
GetStartupProjectOption(startupProject)); |
|
|
|
} |
|
|
|
|
|
|
|
public void RemoveAllMigrations(string solutionFolder) |
|
|
|
{ |
|
|
|
if (Directory.Exists(Path.Combine(solutionFolder, "aspnet-core"))) |
|
|
|
{ |
|
|
|
solutionFolder = Path.Combine(solutionFolder, "aspnet-core"); |
|
|
|
} |
|
|
|
|
|
|
|
var srcFolder = Path.Combine(solutionFolder, "src"); |
|
|
|
|
|
|
|
var migrationsFolder = Directory.GetDirectories(srcFolder) |
|
|
|
.FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore.DbMigrations")); |
|
|
|
|
|
|
|
if (migrationsFolder != null) |
|
|
|
{ |
|
|
|
Directory.Delete(Path.Combine(migrationsFolder, "Migrations"), true); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Logger.LogWarning("No migration found to delete."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual string ParseModuleName(string fullModuleName) |
|
|
|
{ |
|
|
|
var words = fullModuleName?.Split('.'); |
|
|
|
|