Merge pull request #7177 from abpframework/issue/7174

CLI: do not remove migrations for versions older than 4.2.0
pull/7180/head
Yunus Emre Kalkan 5 years ago committed by GitHub
commit 11a0c18c28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using NuGet.Versioning;
using Volo.Abp.Cli.Commands; using Volo.Abp.Cli.Commands;
using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectBuilding.Building.Steps; using Volo.Abp.Cli.ProjectBuilding.Building.Steps;
@ -276,9 +277,13 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App
} }
private static void RemoveMigrations(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) private static void RemoveMigrations(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
if (string.IsNullOrWhiteSpace(context.BuildArgs.Version) ||
SemanticVersion.Parse(context.BuildArgs.Version) > new SemanticVersion(4,1,99))
{ {
steps.Add(new RemoveFolderStep("/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations")); steps.Add(new RemoveFolderStep("/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations"));
} }
}
private static void CleanupFolderHierarchy(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps) private static void CleanupFolderHierarchy(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{ {

Loading…
Cancel
Save