-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres timestamp with time zone after updating to the 5.1.1 packages #11357
Comments
I am aware of that, thanks. When I add AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); to the EntityFrameworkCoreModule PreconfigureServices of my project then I have no problem (the column changes do not appear in the Migration). I see for 5.1.1 this was moved to the AbpDbContext. |
How do you add new migrations? |
Within visual studio Package Manager console --> Add-Migration "Update_To_Abp_5.1.1" |
Can you try to use dotnet ef command? |
|
Can definitely confirm this issue, while not even using 5.1.1. I've started a new solution with AbpSuite 5.0.1 a week ago. Without having made any change whatsoever to the sources, and no Nuget package upgrade, running an Add-Migration today yields a migration that changes the pgsql data type of all DateTime props from I have no idea what is causing this change....
in
but the undesired migration is still being generated. Where is the behaviour for DateTime prop configured during entity configuration, in particular for Npgsql? This is a really blocking, correctly storing datetimes with timezone information is crucial for a Saas app... |
@xxvolvo I DO NOT require the legacy behaviour, but the new Npgsql 6+ one.
It is obviously the path forward with Npgsql, and also a better default behaviour. So the question is, how do I instruct abp to correctly configure DateTime props to |
I'm not sure if Volosoft is giving the adequate attention to this issue. Correctly writing / reading DateTime props via EFCore has some non trivial issues, see https://stackoverflow.com/questions/4648540/entity-framework-datetime-and-utc I'm unsure if / how these aspects are correctly handled by the abpframework. Tightly related to this, I would consider prioritizing to maximum level the usage of NodaTime in the base framework, as requested by #263 I cannot wholeheartedly continue using ABP Commercial until solid handling of timezone-rich DateTime information is implemented and documented... |
Add two lines of code to the AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); The problem is gone. |
Hello,
After updating my project to the latest packages and creating a new migration, all the datetime columns in my PostGres database are converted to "timestamp with time zone" (previously they were "timestamp without time zone").
I assume this is because the new npgsql 6.0 is used, but I see no mentioning in the release notes about this breaking change?
Geert Veenstra
The text was updated successfully, but these errors were encountered: