diff --git a/aspnet-core/services/src/Lion.AbpPro.DbMigrator/DbMigratorHostedService.cs b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/DbMigratorHostedService.cs index e577562a..ac35a4ba 100644 --- a/aspnet-core/services/src/Lion.AbpPro.DbMigrator/DbMigratorHostedService.cs +++ b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/DbMigratorHostedService.cs @@ -1,3 +1,5 @@ +using Volo.Abp.Data; + namespace Lion.AbpPro.DbMigrator { public class DbMigratorHostedService : IHostedService @@ -18,6 +20,8 @@ namespace Lion.AbpPro.DbMigrator options.Services.ReplaceConfiguration(_configuration); options.UseAutofac(); options.Services.AddLogging(c => c.AddSerilog()); + // https://github.com/abpframework/abp/pull/15208 + options.AddDataMigrationEnvironment(); })) { await application.InitializeAsync(); diff --git a/templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs b/templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs index 03a9f6ad..ead9c855 100644 --- a/templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs +++ b/templates/abp-vnext-pro-nuget-all/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs @@ -1,3 +1,5 @@ +using Volo.Abp.Data; + namespace MyCompanyName.MyProjectName.DbMigrator { public class DbMigratorHostedService : IHostedService @@ -18,6 +20,8 @@ namespace MyCompanyName.MyProjectName.DbMigrator options.Services.ReplaceConfiguration(_configuration); options.UseAutofac(); options.Services.AddLogging(c => c.AddSerilog()); + // https://github.com/abpframework/abp/pull/15208 + options.AddDataMigrationEnvironment(); })) { await application.InitializeAsync(); diff --git a/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs b/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs index 71387df0..3d79ea7b 100644 --- a/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs +++ b/templates/abp-vnext-pro-nuget-simplify/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/DbMigratorHostedService.cs @@ -1,3 +1,5 @@ +using Volo.Abp.Data; + namespace MyCompanyName.MyProjectName.DbMigrator { public class DbMigratorHostedService : IHostedService @@ -20,6 +22,8 @@ namespace MyCompanyName.MyProjectName.DbMigrator options.Services.ReplaceConfiguration(_configuration); options.UseAutofac(); options.Services.AddLogging(c => c.AddSerilog()); + // https://github.com/abpframework/abp/pull/15208 + options.AddDataMigrationEnvironment(); })) { await application.InitializeAsync();