symfony2 doctrine decimal precision scale annotations are ignored

我们两清 提交于 2019-12-23 10:57:08

问题


i've set up an attribute in my entity like this :

/**
 * @var decimal
 *
 * @ORM\Column(name="latitude", type="decimal", precision=10, scale=7, nullable=true)
 */
private $latitude;

but when i generate the database schema with : doctrine:database:create; doctrine:schema:create

my field is set up to decimal (10,0) in the database (when i look up with phpmyadmin) and so, when in insert data like 42.123456 with a form, this data is truncated to 42.

how can i resolve this?

Thanks.


回答1:


Ok, finally get to resolve this. Simply manually remove the cache (app/cache/..)

removing it by symfony command cache:clear wont revolve the problem



来源:https://stackoverflow.com/questions/28194792/symfony2-doctrine-decimal-precision-scale-annotations-are-ignored

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!