I\'ve been playing around with Symfony on my web server and I\'ve been creating entity with doctrine for my database. I wanted to add a column to one of these entity... I wa
You definitely DO want to open the PHP/XML/YML file where your entity is defined and add the column there. Then, you use the commandline and say
console doctrine:schema:update
That way, your entity definitions are in sync with the database and your database gets updated.
Add new Column in Existing entity on Symfony. I have the same problem are there . after I long research best solutions are there.
solution work on Symfony 4
Example:
Blog entity already created inside one name column are there and I want to add description column. so simple enter
php bin/console make:entity Blog
After run this command you want to add new column
That's how it worked for me:
src-->AppBundle-->Entity-->YourClassName.php
src-->AppBundle-->Resources-->config-->doctrine-->YourClassName.orm.yml
php bin/console doctrine:schema:update --force