I was using the command with production environment (default).
Solved the issue just using this command (with --env=dev
):
php app/console doctrine:schema:update --dump-sql --env=dev
質問
I've added a property/column (community) to my existing Entity (device). I want the values in this column to be null
by default, so I've done:
/**
* @var integer
*
* @ORM\Column(name="community", type="integer", nullable=true)
*/
private $community = null;
After that, I've updated the database with:
php app/console doctrine:schema:update --dump-sql
but I'm getting:
ALTER TABLE device ADD community INT NOT NULL
So it seems that nullable
option doesn't work, as it is inserting a NOT NULL
field.
解決
I was using the command with production environment (default).
Solved the issue just using this command (with --env=dev
):
php app/console doctrine:schema:update --dump-sql --env=dev