I use Symfony 2.7, doctrine/orm 2.5 and doctrine-bundle 1.5. In Cargo
entity I have property price
:
/**
* @var float
*
* @ORM\Column(name="price", type="float", options={"unsigned":true, "default":0})
*/
protected $price;
In every doctrine migration class I have:
$this->addSql('ALTER TABLE cargo CHANGE price price DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
Despite that previously migration has been executed and default value for price has already set. Why that happens and how to fix it? Or it is better directly set default value to property? According to Doctrine documentation both options are available: