Browse Source
`EnableLegacyTimestampBehavior` if dbms is pgsql.
pull/11871/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: 96224957E51C89E
6 changed files with
21 additions and
0 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/AppNoLayersDatabaseManagementSystemChangeStep.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContextFactory.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs
|
|
|
@ -19,6 +19,7 @@ public class AppNoLayersDatabaseManagementSystemChangeStep : ProjectBuildPipelin |
|
|
|
break; |
|
|
|
|
|
|
|
case DatabaseManagementSystem.PostgreSQL: |
|
|
|
context.Symbols.Add("dbms:PostgreSQL"); |
|
|
|
ChangeEntityFrameworkCoreDependency(context, "Volo.Abp.EntityFrameworkCore.PostgreSql", |
|
|
|
"Volo.Abp.EntityFrameworkCore.PostgreSql", |
|
|
|
"AbpEntityFrameworkCorePostgreSqlModule"); |
|
|
|
|
|
|
|
@ -9,6 +9,10 @@ public class Program |
|
|
|
{ |
|
|
|
public async static Task<int> Main(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
var loggerConfiguration = new LoggerConfiguration() |
|
|
|
#if DEBUG
|
|
|
|
.MinimumLevel.Debug() |
|
|
|
|
|
|
|
@ -8,6 +8,10 @@ public class Program |
|
|
|
{ |
|
|
|
public async static Task<int> Main(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
var loggerConfiguration = new LoggerConfiguration() |
|
|
|
#if DEBUG
|
|
|
|
.MinimumLevel.Debug() |
|
|
|
|
|
|
|
@ -9,6 +9,10 @@ public class Program |
|
|
|
{ |
|
|
|
public async static Task<int> Main(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
var loggerConfiguration = new LoggerConfiguration() |
|
|
|
#if DEBUG
|
|
|
|
.MinimumLevel.Debug() |
|
|
|
|
|
|
|
@ -11,6 +11,10 @@ public class MyProjectNameDbContextFactory : IDesignTimeDbContextFactory<MyProje |
|
|
|
{ |
|
|
|
public MyProjectNameDbContext CreateDbContext(string[] args) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
MyProjectNameEfCoreEntityExtensionMappings.Configure(); |
|
|
|
|
|
|
|
var configuration = BuildConfiguration(); |
|
|
|
|
|
|
|
@ -29,6 +29,10 @@ public class MyProjectNameEntityFrameworkCoreModule : AbpModule |
|
|
|
{ |
|
|
|
public override void PreConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
//<TEMPLATE-REMOVE IF-NOT='dbms:PostgreSQL'>
|
|
|
|
// https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic
|
|
|
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); |
|
|
|
//</TEMPLATE-REMOVE>
|
|
|
|
MyProjectNameEfCoreEntityExtensionMappings.Configure(); |
|
|
|
} |
|
|
|
|
|
|
|
|