EF6 Code-First MySql Forcing to Timestamp

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
jeffs
Posts: 7
Joined: Fri 15 Oct 2010 13:42

EF6 Code-First MySql Forcing to Timestamp

Post by jeffs » Fri 27 Jun 2014 02:11

Hi, we're doing some code-frist work in EF 6.1 targeting mySql, and we're hitting an issue where fields in classes use to hold timestamps (modification and creation times) are mapped to datetime fields in MySql, which truncates the values to the nearest second.

We'd like to get it down towards the millisecond, which I believe a timestamp data type would do.

Are there any tricks to coerce dotConnect to map this type to timestamps instead of datetimes?

jeffs
Posts: 7
Joined: Fri 15 Oct 2010 13:42

Re: EF6 Code-First MySql Forcing to Timestamp

Post by jeffs » Fri 27 Jun 2014 02:18

Well, damn my SQL Server centrism. Turns out that MySql prior to 5.6 always truncates fractional seconds for all data types, so our (impossible) solution is to upgrade to a newer version.

Yay...

Post Reply