I'm struggling with a Doctrine - MySQL microsecond issue. I've already done my research as you can read here: Enabling microseconds in Symfony2 (Doctrine) and MySQL
It appears that the solution might come from what I read here http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html that "datetime" is mapped to DATETIME (instead of DATETIME(6), even if MySQL 5.6 allows it), but the footnote says that DATETIME is
Chosen if the column definition not contains the version option inside the platformOptions attribute array or is set to false which marks it as a non-locking information column.
So I imagine there is a way to specify the version option in the column definition...but was not able to find how. Any idea?
EDIT: I also tried (as suggested below by @Ziumin) to do the following:
/**
* @ORM\Column(type="datetime")
* @ORM\Version
*/
protected $timestamp;
When I perform the following:
php app/console doctrine:schema:update --force
I get:
Updating database schema...
Database schema updated successfully! "1" queries were executed
But in practice nothing changed. The field is now a TIMESTAMP (not a DATETIME as before, nor a DATETIME(6) as it should be), with its fraction of second limitation.
Thank you!