From 4489b7447c106874f350c7d5f0ba93f23fd6776a Mon Sep 17 00:00:00 2001 From: wangjun Date: Fri, 30 Jun 2023 11:36:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Lion.AbpPro.DbMigrator/DbMigratorHostedService.cs | 4 ++++ .../DbMigratorHostedService.cs | 4 ++++ .../DbMigratorHostedService.cs | 4 ++++ 3 files changed, 12 insertions(+) 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();