Skip to content
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

Updated PostgreSQL document for Npgsql datetime change #6426

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/WebSite/EF-Core-PostgreSql-Integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ Change the connection string to your PostgreSQL connection in ***.Web.Mvc/appset
}
```

### Configure DateTime Handling

Starting from **Npgsql** 6.0, Npgsql changed the datetime handling, see the related [issue](https://github.com/npgsql/efcore.pg/issues/2000). This causes an exception in AspNet Boilerplate's default template. So, you need to switch back to old behavior by following [https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic](https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic). Basically you need to set;

````c#
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
````

### Create Database

Before you create the database, you should change the max length of the "Value" property of ApplicationLanguageText by adding the following lines to DbContext.
Expand Down