diff --git a/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceDbContextFactory.cs b/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceDbContextFactory.cs index e1d9b4b0..dfad6ae7 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceDbContextFactory.cs +++ b/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceDbContextFactory.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore; +using System; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; using System.IO; @@ -15,6 +16,9 @@ namespace EShopOnAbp.AdministrationService.EntityFrameworkCore b.MigrationsHistoryTable("__AdministrationService_Migrations"); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + return new AdministrationServiceDbContext(builder.Options); } diff --git a/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceEntityFrameworkCoreModule.cs b/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceEntityFrameworkCoreModule.cs index a9257a22..7e0cc460 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceEntityFrameworkCoreModule.cs +++ b/services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/EntityFrameworkCore/AdministrationServiceEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using System; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.BlobStoring.Database.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -34,6 +35,9 @@ namespace EShopOnAbp.AdministrationService.EntityFrameworkCore options.AddDefaultRepositories(includeAllEntities: true); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + Configure(options => { options.Configure(c => diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContextFactory.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContextFactory.cs index d6a1a616..43711e72 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContextFactory.cs +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceDbContextFactory.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; @@ -20,6 +21,9 @@ namespace EShopOnAbp.IdentityService.EntityFrameworkCore b.MigrationsHistoryTable("__IdentityService_Migrations"); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + return new IdentityServiceDbContext(builder.Options); } diff --git a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreModule.cs b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreModule.cs index e5b0ac95..fb0dbaf9 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreModule.cs +++ b/services/identity/src/EShopOnAbp.IdentityService.EntityFrameworkCore/EntityFrameworkCore/IdentityServiceEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using System; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.PostgreSql; using Volo.Abp.Identity.EntityFrameworkCore; @@ -30,6 +31,9 @@ namespace EShopOnAbp.IdentityService.EntityFrameworkCore options.AddDefaultRepositories(includeAllEntities: true); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + Configure(options => { options.Configure(c => diff --git a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextFactory.cs b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextFactory.cs index 6f0dc5d1..0486119a 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextFactory.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceDbContextFactory.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; @@ -23,6 +24,9 @@ namespace EShopOnAbp.OrderingService.EntityFrameworkCore b.MigrationsHistoryTable("__OrderingService_Migrations"); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + return new OrderingServiceDbContext(builder.Options); } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEntityFrameworkCoreModule.cs b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEntityFrameworkCoreModule.cs index c1042014..ec35b6d1 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEntityFrameworkCoreModule.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.EntityFrameworkCore/EntityFrameworkCore/OrderingServiceEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using System; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.PostgreSql; using Volo.Abp.Modularity; @@ -25,6 +26,9 @@ namespace EShopOnAbp.OrderingService.EntityFrameworkCore options.AddDefaultRepositories(includeAllEntities: true); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + Configure(options => { /* The main point to change your DBMS. diff --git a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextFactory.cs b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextFactory.cs index 6f280a6c..4619ec33 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextFactory.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceDbContextFactory.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; @@ -23,6 +24,9 @@ namespace EShopOnAbp.PaymentService.EntityFrameworkCore b.MigrationsHistoryTable("__PaymentService_Migrations"); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + return new PaymentServiceDbContext(builder.Options); } diff --git a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreModule.cs b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreModule.cs index b3b098fb..4984ef07 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreModule.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.EntityFrameworkCore/EntityFrameworkCore/PaymentServiceEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ -using EShopOnAbp.PaymentService.PaymentRequests; +using System; +using EShopOnAbp.PaymentService.PaymentRequests; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.PostgreSql; @@ -24,6 +25,9 @@ namespace EShopOnAbp.PaymentService.EntityFrameworkCore options.AddRepository(); }); + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + Configure(options => { /* The main point to change your DBMS.