symfony2 doctrine decimal precision scale annotati

2019-06-21 20:33发布

问题:

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