mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1292: Porting problem with timetamp between sqlite and mysql #1624
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jul 25, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user pejot:
There is a problem with the mapping of TIMESTAMP:
/****
/
class User {
(...)
/***
*/
protected $registerDate;
}
While using SQLITE you have to give an INT value otherwise you will get 1970-01-01 01:00:00 as the persisted timestamp,
on MySQL you have to put a string value eg 2011-01-01 00:00:00 otherwise you will get "0000-00-00 00:00:00"
Is quite a big problem when your testing env has other engine than production, than tests against those values are redundant.
@doctrinebot commented on GitHub (Jul 25, 2011):
Comment created by @beberlei:
As the docs say, columnDefinition is not portable. You should write your own type and convert it properly to a DateTime instance or something, see custom mapping type section in the docs.
@doctrinebot commented on GitHub (Jul 25, 2011):
Issue was closed with resolution "Invalid"