First off, I am completely new to Symfony2.
I created an entity -> created a table based on that entity -> created a form using the entity.
I have now realised I need to add a field to the form. So I did the following:
Added the new property -> Added the ORM annotations -> Generated the setters and getters -> ran "php app/console doctrine:schema:update"
This resulted in the following exception: "The table with name 'XXX' already exists"
So nothing was updated. Any idea what I did wrong? Below is the property I added to the entity:
/**
* @var text
*
* @ORM\Column(name="description", type="text")
*
* @Assert\NotBlank(message="Please insert a description")
* @Assert\Length(max=100)
*
*/
private $description;
php app/console doctrine:schema:update
? Firstly, you would need the flagphp app/console doctrine:schema:update --force
to actually run that command. Secondly, the exception you encountered sounds more like something you get when runningphp app/console doctrine:schema:create
on an existing schema; e.gSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'my_table' already exists
. – Darragh Enright