Page 1 of 1

DateTime maps to Date on Postgresql

Posted: Sat 11 Jun 2011 03:07
by detaybey
I am using Devart dotConnect 5.30.165.0
Postgre version 9.0.3 build 1500, 64-bit

I have created a diagram using Devart Entity Model.
My Schema has a class called User.
User has a property called "LastSeen" marked as "DateTime"

when I create the scheme, the field is mapped as "Date" and does not keep the time information (which is required)

In my EDML file, 2 things are seen for "LastSeen" in different locations (I didnt want to dump the whole file)

Code: Select all

  :
  
  :




 :
 
 :




            
              
 :
                
 :

Looks like the DateTime->TimeStamp conversion is done properly on the mapping, but when I use the CreateDatabase() method on my Context, the created file becomes as "Date". There seems to be a problem with creating db, but I believe this is a bug.

Can you help?

as an addition

Posted: Sat 11 Jun 2011 12:35
by detaybey
Also my unit test proves that it cannot persist that field with the time information;

Code: Select all

Tests.ServiceTests.UserServiceTests.CreateUser:
  failed creating user
  Expected:1990-06-11 15:34:07.736
  But was: 1990-06-11 00:00:00.000

Posted: Sat 11 Jun 2011 21:10
by detaybey
Can someone return me about this issue? I don't want to create a second field for time information on all my datetime fields, and this is an urgent matter!

Posted: Tue 14 Jun 2011 13:54
by AndreyR
I have performed a simple test and failed to reproduce the issue.
Could you please send us a small test project illustrating the problem?

Posted: Tue 14 Jun 2011 15:06
by detaybey
I checked "regenerate storage" option while updating database from model and it changed all Date fields with TimeStamp Without Time Zone.

Maybe because I said Database first at the beginning...

Posted: Wed 15 Jun 2011 07:45
by AndreyR
Glad to hear that the issue is resolved.
Feel free to contact us if you encounter any other problems with our components.