How to remove an entity class in a Symfony2 project
data-modeling, doctrine-orm, php, symfony
Solution
Your steps to delete an entity are OK.
You can't remove a table from Doctrine, as Doctrine doesn't know about it. Have a look at this question:
Deleting table using Doctrine2 and Symfony2
Problem
When we initially designed our project, we had a couple of entities that to date are unused (and we don't plan to implement them in the near future). Ergo I want to remove them from my project. I would proceed like this (all steps manually performed): - Remove all relations from my currently used entities. - Delete the doctrime ORM file `src/Resources/config/doctrine` - Delete the class PHP file from `src/Entity` - Remove the table from the database What I would like to know: Are there any routines (e.g. console commands) that may support this procedure? For example, if I run ``` php app/console doctrine:schema:update --dump-sql ``` after having removed all relations and deleted the files, that I get the SQL statement that removes the according table(s)?