From 623b3545b7f96ddb70ee9497a7d9cbf1a66da753 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Mon, 22 Jul 2024 12:25:37 +0200 Subject: [PATCH] fix --- .../Server/Boilerplate.Server.Api/Data/AppDbContext.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs index fce1c8df29..ba5b0bb8a2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Data/AppDbContext.cs @@ -57,16 +57,17 @@ public override int SaveChanges(bool acceptAllChangesOnSuccess) } } - //#if (database == "Sqlite") protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) { //#if (IsInsideProjectTemplate == true) if (Database.ProviderName!.EndsWith("Sqlite", StringComparison.InvariantCulture)) { //#endif + //#if (database == "Sqlite") // SQLite does not support expressions of type 'DateTimeOffset' in ORDER BY clauses. Convert the values to a supported type: configurationBuilder.Properties().HaveConversion(); configurationBuilder.Properties().HaveConversion(); + //#endif //#if (IsInsideProjectTemplate == true) } //#endif @@ -75,16 +76,17 @@ protected override void ConfigureConventions(ModelConfigurationBuilder configura if (Database.ProviderName.EndsWith("PostgreSQL", StringComparison.InvariantCulture)) { //#endif - // SQLite does not support expressions of type 'DateTimeOffset' in ORDER BY clauses. Convert the values to a supported type: + //#if (database == "PostgreSQL") + // PostgreSQL does not support DateTimeOffset with offset other than Utc. configurationBuilder.Properties().HaveConversion(); configurationBuilder.Properties().HaveConversion(); + //#endif //#if (IsInsideProjectTemplate == true) } //#endif base.ConfigureConventions(configurationBuilder); } - //#endif private void ConfigureIdentityTables(ModelBuilder builder) {